Module: Js::Namespace::Framework
- Defined in:
- lib/js_namespace_framework/helper_methods.rb
Defined Under Namespace
Modules: Setup
Instance Method Summary collapse
Instance Method Details
#action_is?(*args) ⇒ Boolean
21 22 23 24 25 26 27 28 |
# File 'lib/js_namespace_framework/helper_methods.rb', line 21 def action_is?(*args) return true if args.include? params[:action] return true if args.include? 'new' and params[:action].eql? 'create' return true if args.include? 'edit' and params[:action].eql? 'update' return false end |
#init_javascript ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/js_namespace_framework/helper_methods.rb', line 5 def init_javascript unless defined? SITE_NAME raise Js::Namespace::Framework::Setup::Error, 'Please define SITE_NAME' end action = params[:action] action = 'new' if params[:action].eql? 'create' action = 'edit' if params[:action].eql? 'update' javascript_tag("#{SITE_NAME}.#{params[:controller]}.#{action}_page();") end |
#requires_javascript? ⇒ Boolean
17 18 19 |
# File 'lib/js_namespace_framework/helper_methods.rb', line 17 def requires_javascript? false end |