This project is archived and is in readonly mode.
link_to with block failing on 2.3.8 with rails_xss
Reported by ipster | May 25th, 2010 @ 07:56 PM | in 2.3.8
I'm getting an
"Undefined method stringify_keys' for
"/foo":ActiveSupport::SafeBuffer"
when I try to pass a block to the link_to helper with rails 2.3.8 and the rails_xss plugin installed.
<% link_to("foo", foo_path) do %>
<span class="bar">blah</span>
<% end %>
calling link_to without the block works fine.
<%= link_to("foo", foo_path) %>
Comments and changes to this ticket
-
Santiago Pastorino May 25th, 2010 @ 09:05 PM
- Milestone set to 2.3.8
- State changed from new to open
- Assigned user set to Jeremy Kemper
Confirmed bug, a missing require.
This method is passing on tests because test/template/url_helper_test.rb loads action_controller, which loads active_support and then we have the stringify on tests loaded. -
Santiago Pastorino May 25th, 2010 @ 09:08 PM
The test i've added is not a test that makes the suite fail is only one more test for link_to with a block.
I think the abstract_test.rb file should be splitted. -
Santiago Pastorino May 25th, 2010 @ 09:10 PM
Attaching a patch without this test because there's another similar
-
Santiago Pastorino May 25th, 2010 @ 09:49 PM
- Tag changed from 2.3.8, link_to, rails_xss to 2.3.8, link_to, patch, rails_xss
- State changed from open to invalid
Sorry i got confused is not a bug.
You have to do ...
<% link_to(foo_path) do %>
<% end %>You're passing a first string parameters that shouldn't be there.
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.htm...
Also there's a missing require on this class patch attached here.
-
Santiago Pastorino May 25th, 2010 @ 09:51 PM
Sorry for the formatting
You should do ...
<% link_to(foo_path) do %> THINGS ... <% end %>
-
Neeraj Singh May 25th, 2010 @ 09:56 PM
Not a bug. As per API you should do
<% link_to(@profile) do %> <strong><%= @profile.name %></strong> -- <span>Check it out!!</span> <% end %>
-
Neeraj Singh May 25th, 2010 @ 09:57 PM
Sorry did not see that super fast Santiago had already updated the ticket. I should have refreshed my page.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>