Class: Maglev::Editor::LinksController

Inherits:
BaseController show all
Defined in:
app/controllers/maglev/editor/links_controller.rb

Instance Method Summary collapse

Methods included from ResourceIdConcern

#resource_id

Instance Method Details

#editObject



15
# File 'app/controllers/maglev/editor/links_controller.rb', line 15

def edit; end

#updateObject



17
18
19
20
21
22
23
# File 'app/controllers/maglev/editor/links_controller.rb', line 17

def update
  # some inputs are displayed based on the value of other inputs
  return unless params[:refresh] == '1' || !@link.valid?

  flash.now[:alert] = flash_t(:error) unless @link.valid?
  render :edit, status: :unprocessable_content
end