Module: Saucy::ProjectsController
- Extended by:
- ActiveSupport::Concern
- Included in:
- ProjectsController
- Defined in:
- lib/saucy/projects_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/saucy/projects_controller.rb', line 23 def create @project = current_account.projects.build(params[:project]) if @project.save redirect_to account_project_url(current_account, @project) else render :action => :new end end |
#destroy ⇒ Object
51 52 53 54 |
# File 'lib/saucy/projects_controller.rb', line 51 def destroy current_project.destroy redirect_to account_projects_url(current_project.account), :notice => "Project has been deleted" end |
#edit ⇒ Object
32 33 34 35 |
# File 'lib/saucy/projects_controller.rb', line 32 def edit @project = current_project set_project_account_if_moving end |
#index ⇒ Object
56 57 58 59 |
# File 'lib/saucy/projects_controller.rb', line 56 def index @active_projects = current_account.projects.active @archived_projects = current_account.projects.archived end |
#new ⇒ Object
16 17 18 19 20 21 |
# File 'lib/saucy/projects_controller.rb', line 16 def new @project = current_account.projects. if @project.keyword.blank? @project.keyword = 'keyword' end end |
#show ⇒ Object
47 48 49 |
# File 'lib/saucy/projects_controller.rb', line 47 def show current_project end |
#update ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/saucy/projects_controller.rb', line 37 def update @project = current_project set_project_account_if_moving if @project.update_attributes params[:project] redirect_to account_projects_url(@project.account), :notice => 'Project was updated.' else render :action => :edit end end |