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 7844511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:54:03+00:00 2026-06-02T16:54:03+00:00

I am a Rails noob and have a problem sending an email from a

  • 0

I am a Rails noob and have a problem sending an email from a show page. There are several contact form tutorials out there but I cannot find one where I send an email from a page like a ‘show’ page. I have big errors in my routes I believe. In the model I state that Users have several Promotions and on the promotions show page I want to allow the current_user to send an email to @user.

here is app/mailers/quote_mailer.rb

class QuoteMailer < ActionMailer::Base
  default :from => "tim@example.com"

  def quote_mail(promotion)
    @user = user
    mail(:to => user.email, :subject => "You have an inquiry homeboy!")
  end 
end

In promotions_controller I put this action which I think might be wrong:

def quotedeliver
  QuoteMailer.quote_mail.deliver
  flash[:notice] = 'report sent!'
  redirect_to root_path # or wherever
end

Here is the form that I use to send the email (the :url is probably wrong but I dont know how it should look)

<%= form_for quote_mail, :url => quotedeliver_promotion_path(promotion), :html => {:method => :put } do |f| %>
  <%= f.text_area :body %>
  <%= f.submit %>
<% end %>

I would love some help with this. I cannot find anything like it on stackoverflow, I have been trying for days. Thank you!

  • 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-06-02T16:54:04+00:00Added an answer on June 2, 2026 at 4:54 pm

    You are probably missing the route in config/routes.rb

    you can define it like

    post '/quotedeliver_promotion' => 'promotions#quotedeliver', :as => quotedeliver_promotion
    

    Note that quotedeliver has to be rewritten quote_deliver to follow ruby syntax conventions. When you call

    QuoteMailer.quote_mail.deliver
    

    You are not giving the parameter, so try this

    QuoteMailer.quote_mail(current_user).deliver
    

    And change your method with

    def quote_mail(user)
      mail ....
    end
    

    and you are all good

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm rails noob, and have been confused about sending params from controller to model.
Rails noob here looking for some advice/direction on something. I have several Pages and
I'm a bit of a rails noob and have this situation. I have a
Rails noob here. I have a rails application with (in this example) three tables.
I am a Rails noob and have a question. I have a feed aggregator
I'm working in Rails 3.1 as a relative noob, and have managed to extract
Noob here. I have a rails app that has users and postings. I need
I'm a total Ruby/Rails/AR noob. I have a very basic sort of database schema
As a git noob trying it out on a Rails project, I am wondering
Noob question for Ruby on Rails- here's an example of my situation: If I

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.