public
Created

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<%= form_tag(add_category_service_path(@service), :method => 'post', :remote => true) do %>
<%= select_tag 'service-category', options_for_select(['test'] %>
<%= submit_tag "Submit", :id => 'submit' %>
<% end %>
 
# controller
def add_category
respond_to do |format|
format.js {
render :text => 'fu'
}
end
end
 
# route
add_category_service POST /services/:id/add_category(.:format) {:action=>"add_category", :controller=>"services"}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.