lib/generators/cms/templates/cms_base_controller.rb in honey-cms-0.4.8 vs lib/generators/cms/templates/cms_base_controller.rb in honey-cms-0.5.1
- old
+ new
@@ -11,11 +11,11 @@
@records = if params[:search].blank?
subject.order('id asc') .page(params[:page]).per(100)
else
subject.search(params[:search]).page(params[:page]).per(100)
end
-
+
set_collection_variable
respond_with(@records)
end
def new
@@ -23,11 +23,11 @@
set_element_variable
respond_with(@record)
end
def create
- @record = subject.create(params[subject.model_name.element])
+ @record = subject.create(subject_params)
set_element_variable
respond_with @record
end
def show
@@ -37,10 +37,10 @@
def edit
respond_with @record
end
def update
- @record.update_attributes params[subject.model_name.element]
+ @record.update_attributes subject_params
respond_with @record
end
def destroy
@record.destroy