Class: Writefully::SitesController
Constant Summary
collapse
- VALID_TABS =
%w(processing errors)
Instance Method Summary
collapse
#authenticate_wf_authorship!, #set_flash, #wf_authorship_signed_in?
Instance Method Details
#create ⇒ Object
29
30
31
32
33
34
35
|
# File 'app/controllers/writefully/sites_controller.rb', line 29
def create
@site = current_wf_authorship.owned_sites.build(site_params)
if @site.save
set_flash :success, object: @site
redirect_to sites_path
end
end
|
#edit ⇒ Object
25
26
27
|
# File 'app/controllers/writefully/sites_controller.rb', line 25
def edit
@site = get_site
end
|
#index ⇒ Object
9
10
11
12
|
# File 'app/controllers/writefully/sites_controller.rb', line 9
def index
@sites = current_wf_authorship.owned_sites
redirect_to new_site_path if @sites.empty?
end
|
#new ⇒ Object
21
22
23
|
# File 'app/controllers/writefully/sites_controller.rb', line 21
def new
@site = current_wf_authorship.owned_sites.build
end
|
#show ⇒ Object
14
15
16
17
18
19
|
# File 'app/controllers/writefully/sites_controller.rb', line 14
def show
@site = get_site
if params[:tab].nil? or not tab_valid?
redirect_to site_posts_path(@site)
end
end
|