Class: Admin::EmailStylesController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/email_styles_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
# File 'app/controllers/admin/email_styles_controller.rb', line 4

def show
  render_serialized(EmailStyle.new, EmailStyleSerializer)
end

#updateObject



8
9
10
11
12
13
14
15
# File 'app/controllers/admin/email_styles_controller.rb', line 8

def update
  updater = EmailStyleUpdater.new(current_user)
  if updater.update(params.require(:email_style).permit(:html, :css))
    render_serialized(EmailStyle.new, EmailStyleSerializer)
  else
    render_json_error(updater.errors, status: 422)
  end
end