Class: GuidesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#login_button, #redirect_to_main_organization!, #should_choose_organization?, #should_redirect_to_main_organization?, #validate_accessible!

Methods included from Mumuki::Laboratory::Controllers::EmbeddedMode

#embedded_mode?, #enable_embedded_rendering, #standalone_mode?

Methods included from Mumuki::Laboratory::Controllers::DynamicErrors

#bad_record, #blocked_forum, #forbidden, #gone, #internal_server_error, #not_found, #render_error, #unauthorized

Methods included from Mumuki::Laboratory::Controllers::Notifications

#has_notifications?, #notifications_count, #user_notifications_path

Methods included from Mumuki::Laboratory::Controllers::Authorization

#authorization_slug, #authorize_if_private!, #from_sessions?

Methods included from Mumuki::Laboratory::Controllers::CurrentOrganization

#organization_name, #set_current_organization!, #visit_organization!

Instance Method Details

#redirect_to_usage(guide) ⇒ Object

Raises:

  • (Mumuki::Domain::NotFoundError)


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

def redirect_to_usage(guide)
  raise Mumuki::Domain::NotFoundError unless guide.usage_in_organization.try { |usage| redirect_to usage }
end

#showObject



2
3
4
# File 'app/controllers/guides_controller.rb', line 2

def show
  redirect_to_usage Guide.find_by!(id: params[:id])
end

#show_by_slugObject



6
7
8
# File 'app/controllers/guides_controller.rb', line 6

def show_by_slug
  redirect_to_usage Guide.by_slug_parts!(params)
end