on_the_spot gem not working
I have just installed the "on_the_spot" gem following the github instructions.
And I'm trying to create a in-place edit for my index action. When I get the mouse over the text that should be editable, nothing happens. Only the background color changes.
This is the relevant code from my index view
<% @part_types.each do |part_type| %>
<tr>
<td><%= on_the_spot_edit part_type, :tit开发者_JS百科le %></td>
</tr>
<% end %>
From the controller:
class PartTypesController < ApplicationController
#on_the_spot for in place editing
can_edit_on_the_spot
#.. rest of the controller code
end
Added to the routes:
resources :part_types do
collection do
put :update_attribute_on_the_spot
end
end
nginx already restarted after these changes.
Thank you
Inside your Gemfile add the following:
gem "on_the_spot" Run the installation task:
rails g on_the_spot:install
if u using rails 3.1 replace created files to app/assets/javascripts (two files jquery.jeditable.mini and on_the_spot)
精彩评论