i use rails_admin.
does know how can show confirmation message (with actions) before update ?
i create custom action or override existing one. this:
class update2 railsadmin::config::actions.register(self) register_instance_option :visible? # end register_instance_option :link_icon # icon here end register_instance_option :http_methods [:get, :post] end register_instance_option :controller proc.new if request.post? @object.update flash[:notice] = "updated #{@object.name}." redirect_to show_path end end end end then create page app/views/rails_admin/main/update2.html.haml
%h3 = "are sure want update '#{@object.name}' = link_to 'update', update2_path, method: 'post', class: "btn btn-danger" = link_to 'cancel', show_path, class: "btn btn-primary" when click update2 go page via get. on post update.
Comments
Post a Comment