Sha256: 0a6dcc6b972195b41d25b8ac0fdaa929860b7ffcd9d23d5253a5cc96675b4cfd
Contents?: true
Size: 608 Bytes
Versions: 7
Compression:
Stored size: 608 Bytes
Contents
module Rails module JS module Routes module ViewHelpers def js_routes namespace = controller_path.split('/').reject do |el| el == controller_name end.join raw [ '<script type="text/javascript">', 'window.Rails = window.Rails || {};', 'Rails.config = {', " controller: '#{controller_name}',", " namespace: '#{namespace}',", " action: '#{action_name}'", '};', '</script>' ].join("\n") end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems