2009/9/4 Aaron Day
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:>
> Lets say I did
>
> script/generate controller home
>
> And in the home controller made a the method..
>
> def say
> puts "You are here"
> end
>
> How would I call that method in the index.html.erb?
>
What do you mean by calling a method of the controller from a view?
Controller methods are generally actions that map to urls so you would
link to the action in the view, so the user invokes that action when
he clicks the link.
If you have not already done so I would recommend working through the
Getting Started guide at http://guides.rubyonrails.org/. Also look at
the other guides. The railscast videos are also excellent.
Colin
> When learning ruby it just said to run the whatever.rb in the terminal
> to run what ever code you wrote within that file. Just curious on how
> that
> would work with rails.
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>