Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 45 lines (37 sloc) 0.943 kB
b09ff3f @mokevnin first commit
authored
1 class Web::Account::CommunitiesController < Web::Account::ApplicationController
2 def index
3 @communities = current_user.communities
4 title 'My communities'
5 end
6
7 def edit
8 @community = current_user.communities.find_by_uri!(params[:id])
9
10 title 'Community edit'
11 end
12
13 def update
14 send :edit
15 if @community.update_attributes(params[:community])
16 flash[:notice] = 'Community was successfully updated.'
17 redirect_to :action => :edit
18 else
19 render :action => :edit
20 end
21 end
22
23 def new
24 @community = Community.new
c762201 @mokevnin mega update
authored
25
26 title 'New community'
b09ff3f @mokevnin first commit
authored
27 end
28
29 def create
30 @community = current_user.communities.build(params[:community])
31 if @community.save
32 flash[:notice] = 'Community was successfully created.'
33 redirect_to :action => :index
34 else
35 render :action => :new
36 end
37 end
38
39 def destroy
40 send :edit
41 @community.destroy
42 redirect_to :action => :index
43 end
44 end
Something went wrong with that request. Please try again.