> It not that @controller contains a reference to you controller -
> it is an actual instance of it.
OK, I phrased that badly.
> And 'prepending a method call' sounds like you think there is some
> magic going on - there isn't - methods are always called on a certain
> object (omitting the objec
On Aug 9, 9:08 pm, Jim Burgess wrote:
> Hi,
>
> Thanks for all of the replies.
> That has really made things a lot clearer for me.
>
> So, to summarize:
>
> 'url_for' is a method defined in ActionController::Base.
>
> @controller is an instance variable initiated by
> ActionController::TestCase co
Hi,
Thanks for all of the replies.
That has really made things a lot clearer for me.
So, to summarize:
'url_for' is a method defined in ActionController::Base.
@controller is an instance variable initiated by
ActionController::TestCase containing a reference to my controller
(PagesController)
On Aug 9, 8:14 pm, Jim Burgess wrote:
> assert_select "a[href=?]", @controller.url_for(:action => :new,
> :only_path => true), :text => 'Neue Seite'
>
> How is he able to reference a method defined in another class, simply by
> prefixing the method call with '@controller'
>
> Could someone expl
4 matches
Mail list logo