Created
November 17, 2013 19:51
-
-
Save brunoandradd/7517437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ResumosFinanceirosController < ApplicationController | |
before_filter do | |
@consulta_previa = ConsultaPrevia.find(params[:consulta_previa_id]) | |
end | |
def edit | |
@investimentos = Investimentos.new(@consulta_previa.empreendimento) | |
@fontes = Fontes.new(@consulta_previa.empreendimento) | |
@resumo_financeiro = @consulta_previa.empreendimento.resumo_financeiro | |
end | |
def update | |
@resumo_financeiro = @consulta_previa.empreendimento.resumo_financeiro | |
@resumo_financeiro.update_attributes(params[:resumo_financeiro]) | |
respond_with @resumo_financeiro, | |
location: edit_consulta_previa_empreendimento_resumo_financeiro_path(@consulta_previa) | |
end | |
def create | |
@resumo_financeiro = ResumoFinanceiro.new(params[:resumo_financeiro]) | |
@resumo_financeiro.save | |
respond_with @resumo_financeiro, | |
location: edit_consulta_previa_empreendimento_resumo_financeiro_path(@consulta_previa) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exemplo de um controller, que constumo fazer