Genji wrote in post #1016242:
> So can i write an action in the village controller and use it like
> this?
>
> <%= link_to 'Update', village_path(@village), :method
> => :put , :action => building_upgrade %>
>
No. This:
village_path(@village)
produces the path for the link. As I showed in my earlier post, you can
specify the path yourself like this:
<%= link_to "Click me",
{:controller => 'users', :action => 'get_info'} %>
Note that in both cases, the path is the second argument to link_to.
> So can i write an action in the village controller and use it
You can write any action you want in your controller, then as long as
you provide a route for it in your route.db file, you can use the proper
path in your link to call the action.
> i hope you can figure out what i mean...
Not really. As far as I can tell, Building is irrelevant.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.