Class: RequestWizardsController

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationController

#add_breadcrumb, #after_sign_in_path_for, #breadcrumbs, #new_session_path, #render_not_found, #require_admin_user

Instance Attribute Details

#request_modelObject (readonly)

Returns the value of attribute request_model.



10
11
12
# File 'app/controllers/request_wizards_controller.rb', line 10

def request_model
  @request_model
end

Instance Method Details

#saveObject

PUT /request_wizards/1/save



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/request_wizards_controller.rb', line 19

def save
  # save and render the requested step
  save_request
  notice_message = "Draft request saved automatically. To open or delete your draft, select the dropdown menu next to 'New Project Request'."
  if params["redirectUrl"] == "undefined" # clicking the tigerdata logo
    redirect_to dashboard_path
    flash[:notice] = notice_message
  elsif params["redirectUrl"]
    if params["redirectUrl"].include?("dashboard") # clicking the dashboard breadcrumb
      redirect_to dashboard_path
      flash[:notice] = notice_message
    else
      redirect_to params["redirectUrl"] # clicking a sidebar step
    end
  else
    redirect_to_requested_step
  end
end

#showObject

GET /request_wizards/1



13
14
15
16
# File 'app/controllers/request_wizards_controller.rb', line 13

def show
  # show the current wizard step form
  render_current
end