Module: ExtFormSubmit

Defined in:
lib/generators/controller/concerns/ext_form_submit.rb

Instance Method Summary collapse

Instance Method Details

#flash_alert(obj) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/generators/controller/concerns/ext_form_submit.rb', line 10

def flash_alert(obj)
  err_str = view_context.render_for_controller("validation_errors", {:obj => obj})
  msg = ("Unable to #{action_name} #{obj.class} for the following" + 
    " " + view_context.pluralize(obj.errors.full_messages.length, "reason") + 
    ":#{err_str}") unless obj.errors.messages.size < 1
  flash.now[:error] = msg.html_safe
end

#redir_urlObject



2
3
4
5
6
7
8
# File 'lib/generators/controller/concerns/ext_form_submit.rb', line 2

def redir_url()
  if params[:btn_reload]
    :back
  else
    eval("#{params[:controller]}_url")
  end
end