Deprecated posts replaced with method _______?

Looking at this snippet:

[email protected] ~/strawr $
[email protected] ~/strawr $ cat app/views/feeds/show.rhtml -n | head -n 36
| tail -n 13
24
25 <% if @feed.tags.empty? %>
26 (None)


27 <% else %>
28 <% for tag in @feed.tags %>
29 <%= tag.tag %> 
30 <%= link_to ‘Remove’, { :action => ‘remove_tag’,
31 :id => @feed, :which_tag => tag.id },
32 :confirm => ‘Are you sure?’, :post => true %>
33

34 <% end %>
35 <% end %>
36
[email protected] ~/strawr $

http://strawr.googlecode.com/svn/trunk/

I believe that the :post in line 32 is, or will be, deprecated:

Tag Load (0.003368) SELECT tags.* FROM tags INNER JOIN memberships
ON
tags.id = memberships.tag_id WHERE ((memberships.feed_id = 1))
Tag Columns (0.001263) SHOW FIELDS FROM tags
DEPRECATION WARNING: Passing :post as a link modifier is deprecated.
Use :method => “post” instead. :post will be removed in Rails 2.0. See
http://www.rubyonrails.org/deprecation for details. (called from
convert_options_to_javascript! at /usr/lib/ruby/gems/1.8/gems/
actionpack-1.13.5/lib/action_view/helpers/url_helper.rb:331)

Do I just make line 32:

  :confirm => 'Are you sure?', :method => "post" => true %>

I’m not sure what they’re getting at. Yes, I’ll read those links in the
morning more thoroughly.

thanks,

Thufir

<%= link_to ‘Remove’, { :action => ‘remove_tag’,
:id => @feed, :which_tag => tag.id },
:confirm => ‘Are you sure?’, :method => :post %>

That is how it should look. Replace the :post key with the :method key.
So now you just say :method => :post or :method => :put, etc

On Jan 20, 6:50 am, Nathan E. <rails-mailing-l…@andreas-
s.net> wrote:

<%= link_to ‘Remove’, { :action => ‘remove_tag’,
:id => @feed, :which_tag => tag.id },
:confirm => ‘Are you sure?’, :method => :post %>

That is how it should look. Replace the :post key with the :method key.
So now you just say :method => :post or :method => :put, etc

Ah, thanks. I wasn’t seeing hot to include the :true

-Thufir

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs