Class: Locomotive::CurrentSiteController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::CurrentSiteController
- Defined in:
- app/controllers/locomotive/current_site_controller.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #edit ⇒ Object
- #new_domain ⇒ Object
- #new_locale ⇒ Object
- #new_url_redirection ⇒ Object
- #update ⇒ Object
Instance Method Details
permalink #destroy ⇒ Object
[View source]
26 27 28 29 30 |
# File 'app/controllers/locomotive/current_site_controller.rb', line 26 def destroy @site @site.destroy respond_with @site, location: sites_path end |
permalink #edit ⇒ Object
[View source]
15 16 17 18 |
# File 'app/controllers/locomotive/current_site_controller.rb', line 15 def edit @site respond_with @site end |
permalink #new_domain ⇒ Object
[View source]
32 33 34 35 36 37 38 |
# File 'app/controllers/locomotive/current_site_controller.rb', line 32 def new_domain if params[:domain].present? render partial: 'domain', locals: { domain: params[:domain] } else head :unprocessable_entity end end |
permalink #new_locale ⇒ Object
[View source]
40 41 42 43 44 45 46 |
# File 'app/controllers/locomotive/current_site_controller.rb', line 40 def new_locale if params[:locale].present? render partial: 'locale', locals: { locale: params[:locale] } else head :unprocessable_entity end end |
permalink #new_url_redirection ⇒ Object
[View source]
48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/locomotive/current_site_controller.rb', line 48 def new_url_redirection if params[:url_redirection].present? && params[:url_redirection].include?(' ') source, target = params[:url_redirection].split(' ') render partial: 'url_redirection', locals: { url_redirection: { 'source' => source, 'target' => target } } else head :unprocessable_entity end end |
permalink #update ⇒ Object
[View source]
20 21 22 23 24 |
# File 'app/controllers/locomotive/current_site_controller.rb', line 20 def update @site service.update(@site, site_params) respond_with @site, location: -> { edit_current_site_path(current_site) } end |