Class: HeraCms::LinksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/hera_cms/links_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject

def edit

@link = HeraCms::Link.find(params[:id])

end



18
19
20
21
22
23
24
25
26
# File 'app/controllers/hera_cms/links_controller.rb', line 18

def update
  @link = HeraCms::Link.find(params[:id])

  if @link.update(link_params)
    render json: { redirect: URI(request.referer).path }, status: 200
  else
    render json: { errors: @link.errors.full_messages }, status: 422
  end
end