end
end
+ def leaf_created_html_format format, redirect_url
+ format.html {
+ flash[:notice] = I18n.t('flash.notice.created', :model => @my_model_class.model_name.human)
+ redirect_to redirect_url
+ }
+ end
+
+ def leaf_not_created_html_format format, redirect_url
+ format.html {
+ flash[:notice] = I18n.t('flash.notice.not_created', :model => @my_model_class.model_name.human)
+ redirect_to redirect_url
+ }
+ end
+
+ def leaf_render_create redirect_url
+ if @item.store @operators
+ respond_to do |format|
+ leaf_created_html_format format, redirect_url
+ created_json_format format
+ end
+ else
+ respond_to do |format|
+ leaf_not_created_html_format format, redirect_url
+ not_created_json_format format
+ end
+ end
+ end
+
def updated_html_format format
format.html {
flash[:notice] = I18n.t('flash.notice.updated', :model => @my_model_class.model_name.human)
end
end
+ def leaf_updated_html_format format, redirect_url
+ format.html {
+ flash[:notice] = I18n.t('flash.notice.updated', :model => @my_model_class.model_name.human)
+ redirect_to redirect_url
+ }
+ end
+
+ def leaf_not_update_html_format format, redirect_url
+ format.html {
+ flash[:notice] = I18n.t('flash.notice.not_updated', :model => @my_model_class.model_name.human)
+ redirect_to redirect_url
+ }
+ end
+
+ def leaf_render_update ot, redirect_url
+ if @item.store @operators, ot
+ respond_to do |format|
+ leaf_updated_html_format format, redirect_url
+ updated_json_format format
+ end
+ else
+ respond_to do |format|
+ leaf_not_updated_html_format format, redirect_url
+ not_updated_json_format format
+ end
+ end
+ end
+
def list_count
set_list
j = {:count => @list.count(@operators, {:id => params[:id]})}