app/controllers/adminpanel/sections_controller.rb in adminpanel-2.1.7 vs app/controllers/adminpanel/sections_controller.rb in adminpanel-2.2.0
- old
+ new
@@ -1,20 +1,18 @@
module Adminpanel
class SectionsController < Adminpanel::ApplicationController
- # authorize_resource
- authorize_resource
# def new
# @section = Section.new
# authorize! :create, @section
# end
def edit
@section = Section.find(params[:id])
- respond_to do |format|
- format.html
- format.json {render :json => {:section => @section }}
- end
+ # respond_to do |format|
+ # format.html
+ # format.json {render :json => {:section => @section }}
+ # end
end
def update
@section = Section.find(params[:id])
@@ -41,17 +39,16 @@
end
private
def section_params
params.require(:section).permit(
- :description,
- :has_image,
- :key,
- :page,
- :name,
- :has_description,
- :images_attributes => [:id, :file]
+ :has_description,
+ :description,
+ :key,
+ :page,
+ :name,
+ :has_image,
+ images_attributes: [:id, :file]
)
-
end
end
end