Class: IterationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IterationsController
- Defined in:
- lib/branston/app/controllers/iterations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /iterations POST /iterations.xml.
-
#destroy ⇒ Object
DELETE /iterations/1 DELETE /iterations/1.xml.
-
#edit ⇒ Object
GET /iterations/1/edit.
-
#index ⇒ Object
GET /iterations GET /iterations.xml.
-
#new ⇒ Object
GET /iterations/new GET /iterations/new.xml.
-
#show ⇒ Object
GET /iterations/1 GET /iterations/1.xml.
-
#update ⇒ Object
PUT /iterations/1 PUT /iterations/1.xml.
Instance Method Details
#create ⇒ Object
POST /iterations POST /iterations.xml
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/branston/app/controllers/iterations_controller.rb', line 70 def create @iteration = Iteration.new(params[:iteration]) respond_to do |format| if @iteration.save flash[:notice] = 'Iteration was successfully created.' format.html { redirect_to iterations_path } format.xml { render :xml => @iteration, :status => :created, :location => @iteration } else @releases = Release.all format.html { render :action => "new" } format.xml { render :xml => @iteration.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /iterations/1 DELETE /iterations/1.xml
106 107 108 109 110 111 112 113 114 |
# File 'lib/branston/app/controllers/iterations_controller.rb', line 106 def destroy @iteration = Iteration.find(params[:id]) @iteration.destroy respond_to do |format| format.html { redirect_to(iterations_url) } format.xml { head :ok } end end |
#edit ⇒ Object
GET /iterations/1/edit
63 64 65 66 |
# File 'lib/branston/app/controllers/iterations_controller.rb', line 63 def edit @releases = Release.all @iteration = Iteration.find(params[:id]) end |
#index ⇒ Object
GET /iterations GET /iterations.xml
28 29 30 31 32 33 34 35 |
# File 'lib/branston/app/controllers/iterations_controller.rb', line 28 def index @iterations = Iteration.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @iterations } end end |
#new ⇒ Object
GET /iterations/new GET /iterations/new.xml
52 53 54 55 56 57 58 59 60 |
# File 'lib/branston/app/controllers/iterations_controller.rb', line 52 def new @releases = Release.all @iteration = Iteration.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @iteration } end end |
#show ⇒ Object
GET /iterations/1 GET /iterations/1.xml
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/branston/app/controllers/iterations_controller.rb', line 39 def show @iteration = Iteration.find(params[:id]) @iteration_data = @iteration.burndown_data respond_to do |format| format.html # show.html.erb format.xml { render :xml => @iteration } end end |
#update ⇒ Object
PUT /iterations/1 PUT /iterations/1.xml
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/branston/app/controllers/iterations_controller.rb', line 88 def update @iteration = Iteration.find(params[:id]) respond_to do |format| if @iteration.update_attributes(params[:iteration]) flash[:notice] = 'Iteration was successfully updated.' format.html { redirect_to iterations_path } format.xml { head :ok } else @releases = Release.all format.html { render :action => "edit" } format.xml { render :xml => @iteration.errors, :status => :unprocessable_entity } end end end |