Need help making code more rails like!

Hi all, I’ve been a PHP programmer for many years and I’ve recently
up ruby and rails and am loving it! However, I’m still learning the
way” of doing things and I’ve got a block of code that I think could use
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
the call to check_box_tag(). Thanks in advance for any assistance!

The following code is contained within a partial (excuse the formatting

<% for course in @courses -%>
<%= %>:
<% if == session[:current_course].to_s -%>
<%= check_box_tag ‘post_courses[]’,, true,
=> ‘disabled’} %>

<% else -%>
<%= check_box_tag ‘post_courses[]’, %>

<% end -%>
<% end -%>

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