Class: FundosController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- FundosController
- Defined in:
- app/controllers/fundos_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /banners POST /banners.xml.
- #destroy ⇒ Object
-
#edit ⇒ Object
GET /banners/1/edit.
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
POST /banners POST /banners.xml
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/fundos_controller.rb', line 26 def create @fundo = Fundo.new(params[:fundo]) respond_to do |format| if @fundo.save flash[:notice] = 'Fundo adicionado com sucesso.' format.html { redirect_to(fundos_url)} else format.html { render :action => "new" } end end end |
#destroy ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'app/controllers/fundos_controller.rb', line 52 def destroy @fundo = Fundo.find(params[:id]) @fundo.destroy respond_to do |format| format.html { redirect_to(fundos_url) } end end |
#edit ⇒ Object
GET /banners/1/edit
20 21 22 |
# File 'app/controllers/fundos_controller.rb', line 20 def edit @fundo = Fundo.find(params[:id]) end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/fundos_controller.rb', line 9 def index @fundos = Fundo.all end |
#new ⇒ Object
14 15 16 17 |
# File 'app/controllers/fundos_controller.rb', line 14 def new @fundo = Fundo.new end |
#update ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/fundos_controller.rb', line 39 def update @fundo = Fundo.find(params[:id]) respond_to do |format| if @fundo.update_attributes(params[:fundo]) flash[:notice] = 'Fundo adicionado com sucesso.' format.html { redirect_to(fundos_url)} else format.html { render :action => "edit" } end end end |