Method: BootstrapAdminHelper#render_with_fallback
- Defined in:
- app/helpers/bootstrap_admin_helper.rb
#render_with_fallback(*args) ⇒ Object
Tries to render the action/partial “namespaced” with the current action name if it fails, then simply calls render with whatever args that got passed in.
Ex:
# on get to '/admin/some_resource/new'
render_with_fallback 'form' # this will to render 'new_form', if it fails,
# then it will just call "render 'form'"
260 261 262 263 264 |
# File 'app/helpers/bootstrap_admin_helper.rb', line 260 def render_with_fallback *args render "#{params[:action]}_#{args.first}", *args[1..-1] rescue ActionView::MissingTemplate render *args end |