Sha256: b23506b13905e0a0d32121a6688ce29d731a3ea14fbb9f7dc9c9588cc94ccf88
Contents?: true
Size: 745 Bytes
Versions: 18
Compression:
Stored size: 745 Bytes
Contents
module Locomotive class SitesController < BaseController sections 'settings' respond_to :json, only: [:create, :destroy] def new @site = Site.new respond_with @site end def create @site = Site.new(params[:site]) @site.memberships.build account: self.current_locomotive_account, role: 'admin' @site.save respond_with @site, location: edit_my_account_path end def destroy @site = self.current_locomotive_account.sites.find(params[:id]) if @site != current_site @site.destroy else @site.errors.add(:base, 'Can not destroy the site you are logging in now') end respond_with @site, location: edit_my_account_path end end end
Version data entries
18 entries across 18 versions & 1 rubygems