Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/app/controllers/macros_controller.rb b/app/controllers/macros_controller.rb
- index 1faa1ee..37c381c 100644
- --- a/app/controllers/macros_controller.rb
- +++ b/app/controllers/macros_controller.rb
- @@ -16,7 +16,7 @@ class MacrosController < ApplicationController
- end
- def create
- - @macro = WikiMacro.new(params[:wiki_macro])
- + @macro = WikiMacro.new(macro_params)
- if request.post? && @macro.save
- flash[:notice] = l(:notice_successful_create)
- @macro.register!
- @@ -26,12 +26,16 @@ class MacrosController < ApplicationController
- end
- end
- + def macro_params
- + params.require(:wiki_macro).permit(:name, :description, :content)
- + end
- +
- def edit; end
- def update
- if request.patch?
- old_name = @macro.name
- - @macro.attributes = params[:wiki_macro]
- + @macro.attributes = macro_params
- name_changed = @macro.name_changed?
- desc_changed = @macro.description_changed?
- if @macro.save
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement