I think what was confusing you was the difference between url_options
and html_options. They are not named in the most descriptive format,
but the source is much clearer. The only things that end up in
url_options are things that you can pass to url_for: so
neither :method nor :confirm belong there. You'd pass a hash in that
position if you were, for instance, using old-style routes
(passing :controller and :action explicitly).
All the stuff that ends up producing HTML bits ends up in the last
option.
The example that I think several of the previous posters were thinking
of (splitting the two arrays with {}) is typically encountered with
form_for; but note that form_for takes URL parameters with the :url
key.
--Matt Jones
On Jul 8, 8:50 am, James Byrne <[email protected]>
wrote:
> Älphä Blüë wrote:
> > <%= link_to('Your Link', your_controller_path, :confirm => 'Are you
> > sure?', :method => :post, :id => "css_id", :class => "css_class") %>
>
> Thank you to all who replied. I am on Rails 2.3.2 and yes, the code
> above does work for me as well. I cannot gather from the API documents
> that this should work however, which is why I never tried it.
> --
> Posted viahttp://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
-~----------~----~----~----~------~----~------~--~---