Module: FrontendNotifierControllerExtension
- Defined in:
- lib/frontend_notifier/application_controller.rb
Instance Method Summary collapse
Instance Method Details
#notify_frontend(message, error_type = "error") ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/frontend_notifier/application_controller.rb', line 3 def notify_frontend(, error_type="error") unless .kind_of? String || .nil? if .errors.empty? = "Success" error_type = "success" else = join_model_errors() end end render :json => { :type => error_type, :message => } end |