<%= fields_for item do |f| %> <%= checkbox_f f, :use_image, :label => _("OS Image"), :help_inline => _("Build from OS image"), :onchange => 'use_image_selected(this)', :'data-url'=> method_path('use_image_selected'), :'data-type' => controller_name %> <%= text_f f, :image_file, :disabled => !item.use_image, :class => "span6" %> <% end -%>