On Tue, Sep 21, 2010 at 4:14 PM, rodrigo3n <[email protected]> wrote:

> Hello everyone, I have a messages_controller, inside this controller,
> among all the default methods I have a tweet method that sends the
> message to twitter, and aside the 'edit' and 'destroy' links I want a
> 'tweet' one. However, I don't know how invoke this method in my app/
> views/messages/index.html.erb and I don't know if I must add something
> in config/routes.rb, if you know, please help me!
>
> Thanks!
>
> Rodrigo Alves Vieira!


Assuming you're using Rails 3, read the guide on routing:
http://guides.rubyonrails.org/routing.html. It's very helpful and will
explain how to connect a new action like you have here. The upshot is to
route it as a member action that can be invoked on a specific Message. Then
you'll have a nice named route you can use in your view, like
tweet_message_path(@message).

-- 
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.

Reply via email to