Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6713045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:19:57+00:00 2026-05-26T08:19:57+00:00

I have an e-mail action.. simple link: <%= link_to ‘Send offer by mail’, offer_to_mail_car_path(@car)

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:19:57+00:00Added an answer on May 26, 2026 at 8:19 am

    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

    def request_by_mail(car, your_name, your_message)
        @car = car
        @name = your_name
        @message = your_message
        @url  = "http://cardealer.com/cars"
      #  attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png")
        mail(:to => 'rmagnum2002@gmail.com',
             :subject => "Car details request from a client",
             :date => Time.now
             )
      end
    

    in cars_controller

    def request_by_mail
        @car = Car.find(params[:id])
        mail = params[:request_by_mail][:your_mail]
        message = params[:request_by_mail][:your_message]
        CarMailer.request_by_mail(@car, name, message).deliver
        redirect_to @car, :notice  => "Request sent."
      end
    

    and the view where the form will be:

        <%= form_for :request_by_mail, :url => request_by_mail_car_path(@car), :html => {:method => :get} do |f| %>
                       <p>
                         <b>Your email:</b><br>
                         <%= f.text_field :your_name %>
                       </p>
                       <p>
                         <b>Details about your request:</b><br>
                         <%= f.text_area :your_message %>
                       </p>
                         <%= f.submit "Send details request" %>
                     <% end %>
    

    now the e-mail template request_by_mail.html.erb

    <!DOCTYPE html>
    <html>
      <head>
        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
      </head>
      <body>
        <h3>A client has requested details about car with stock number: <%= @car.id %></h3>
    
    <% for asset in @car.assets %>
        <img alt="photos" src="http://localhost:3002<%= asset.asset.url(:thumb) %>">
    <% end %>
    
    <p><%= @name %></p>
    
    <p><%= @message %></p>
    
        <p>
          Car link: <a href="http://localhost:3002/cars/<%= @car.id %>">Go to car</a>
        </p>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some action. I want send mail. usually i doing this way. public
I have this mail script I have to run a few times. To start
Is there a gem or way to send a mail with action mailer to
I have a simple email form: <form method=post action=process-form.php id=emailForm name=emailForm target=_self> <h4>Sign up
I have a html form that his action is for exmaple.com/mail.php?name=dan for example. How
I have place this on my application.ini file: contact.email.address = my.mail@bla.org contact.email.name = Test
This should be an easy one to track down...but it isn't proving that way
I have mail server configuration data (server - user name - password - port)
I have a mail webform where I have to show the user only (-1)
I have implemented mail composer. But it opens mail composer whenever user had implemented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.