-
-
Save fitoria/49330 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def save_offer | |
if request.post? | |
@offer = Offer.new(params[:offer]) | |
@offer.post = Post.find_by_id(session[:post_id]) | |
@offer.save | |
redirect_to :controller => 'post', :action => 'show' , :id => params[:id] | |
end | |
end | |
def add_offer #accion para agregar oferta | |
session[:post_id] = params[:id] #agregamos variable de sesion para saber que post es | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment