app/controllers/cms/fortress/roles_controller.rb in cms-fortress-1.0.6 vs app/controllers/cms/fortress/roles_controller.rb in cms-fortress-1.0.7

- old
+ new

@@ -24,9 +24,24 @@ format.html # show.html.erb format.json { render json: @cms_fortress_role } end end + def refresh + @cms_fortress_role = Cms::Fortress::Role.find(params[:id]) + @cms_fortress_role.load_defaults + + respond_to do |format| + if @cms_fortress_role.save + format.html { redirect_to @cms_fortress_role } + format.json { render json: @cms_fotress_role } + else + format.html { render action: "show" } + format.json { render json: @cms_fortress_role.errors, status: :unprocessable_entity } + end + end + end + # GET /cms/fortress/roles/new # GET /cms/fortress/roles/new.json def new @cms_fortress_role = Cms::Fortress::Role.new