Hi all, I''ve been a PHP programmer for many years and I''ve
recently picked
up ruby and rails and am loving it! However, I''m still learning the
"rails
way" of doing things and I''ve got a block of code that I think
could use a
face lift. Any help, tips, suggestions, you can offer in making it more
rails-like is greatly appreciated. The only thing that I need for sure is
the call to check_box_tag(). Thanks in advance for any assistance!
The following code is contained within a partial (excuse the formatting
mess):
<% for course in @courses -%>
<%= course.name %>:
<% if course.id.to_s == session[:current_course].to_s -%>
<%= check_box_tag ''post_courses[]'', course.id,
true, {:disabled
=> ''disabled''} %><br />
<% else -%>
<%= check_box_tag ''post_courses[]'', course.id
%><br />
<% end -%>
<% end -%>
--
Ryan Prins
rprins@gmail.com
http://www.lazyi.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/9525c915/attachment.html