Sha256: c9ea6660537b8af4a3882721d69d2be926eb4e3fee8fe28ee02d723bdf7e5044

Contents?: true

Size: 507 Bytes

Versions: 16

Compression:

Stored size: 507 Bytes

Contents

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

  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
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
controller_scaffolding-1.4.4 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.4.3 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.4.2 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.4.1 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.4.0 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.3.0 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.2.0 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.1.1 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.1.0 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.0.4 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.0.3 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.0.2 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.0.1 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-1.0.0 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-0.1.5 lib/generators/controller/concerns/ext_form_submit.rb
controller_scaffolding-0.0.52 lib/generators/controller/concerns/ext_form_submit.rb