I have an e-mail action.. simple link:
<%= link_to 'Send offer by mail', offer_to_mail_car_path(@car) %>
this one should send a notification to the admin mail that some client is offering a specific amount of money for this car. So the client must insert in to a form his email and his offer. This data are not stored in database, it’s just for sending email and clear out. So for now I do recieve email with car data, name, urls to pictures etc.. but how do I build a form to show up those 2 fields with clients email and offer, how the controller will look and the link itself. Thanks for your priceless time.
controller:
def offer_to_mail
@car = Car.find(params[:id])
CarMailer.offer_to_mail(@car).deliver
redirect_to @car, :notice => "Offer sent."
end
I got the answer thanks to a friend of mine. I’ll post here the solution cause may be some one need this too.
in car mailers will do
in cars_controller
and the view where the form will be:
now the e-mail template request_by_mail.html.erb