Class: Marty::ComponentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/marty/components_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#failed_authentication, #find_current_user, #get_conf, #handle_unverified_request, #logout_user, #password_authentication, #reset_signed_cookies, #session_expiration, #session_expired?, #set_signed_cookies, #set_user, #start_user_session, #successful_authentication, #toggle_dark_mode, #try_to_autologin, #user_setup

Instance Method Details

#indexObject

This is useful for individual component testing. Note that the appropriate route needs to be defined. <base_url>/components/<ComponentCamelCaseName>



6
7
8
9
10
11
12
13
14
# File 'app/controllers/marty/components_controller.rb', line 6

def index
  component = params[:component]

  return redirect_to root_path unless component

  cname = component.gsub('::', '_').underscore
  render layout: true,
  inline: "<%= netzke :#{cname}, class_name: '#{component}', height: 650 %>"
end