This project is archived and is in readonly mode.
tag_options should properly handle arrays
-
Tomasz Mazur
fixed example:
['tom' => 'admin', 'jim' => 'user'].each_pair do |nick, role| <%= content_tag(:span, nick, :class => ["role", role]) %> end
-
Rizwan Reza
- Assigned user set to Pratik
- Tag changed from bugmash to bugmash, verified
verified.
+1 The patch attached includes tests. I think this will help creating multiple content tags.
-
Nick Quaranto
- Assigned user cleared.
- Tag changed from bugmash, verified to bugmash
Added some tests and refactored Tomasz's implementation. You'll have to apply his patch then mine to get this working cleanly.
-
Nick Quaranto
- Assigned user set to Pratik
- Tag changed from bugmash to bugmash, verified
Looks like Rizwan implemented it as well, sans refactoring. I didn't reload the page to check before, so I'm adding the tags back in.
-
Dan Croak
+1 verified
tag_options.diff and 0001-Added-tests-for-using-an-Array-in-tag_options-and-re.patch apply cleanly
and rake test_action_pack runs green on 2-3-stable
-
Josh Nichols
- Assigned user cleared.
+1, because I usually end up using :class => "something #{some_variable}" instead of dealing with an array.
Verified the patches are cool.
-
Nick Quaranto
- Assigned user set to Pratik
Here's a patch that gives credit to Tomasz and is based off master.
-
Rizwan Reza
@@ ruby {'tom' => 'admin', 'jim' => 'user'}.each do |nick, role| <%= content_tag(:span, nick, :class => ["nickname", role]) %> end
@@This works well with these patches too. Hash is good too. :)
-
José Valim
- State changed from incomplete to resolved
- Tag changed from bugmash, verified to verified
-
Repository
(from [5786395760f1e1906c878df4023cac3741e66e87]) Allow content_tag options to take an array [#1741 tag_options should properly handle arrays state:resolved] [rizwanreza, Nick Quaranto]
Example:
content_tag('p', "limelight", :class => ["song", "play"]) # =>limelight
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/5786395760f1e1906c878df4023cac...
