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

  • Home
  • SEARCH
  • 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 3945138
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:59:02+00:00 2026-05-20T00:59:02+00:00

I am running Ruby on Rails 3 and I would like to use URLs

  • 0

I am running Ruby on Rails 3 and I would like to use URLs in mailer view files with namespaces and custom member actions. I read this but I have still problems on implementing that.

In routes.rb I have:

namespace "users" do
  resources :accounts do
    member do
      get 'my_action_name'
      post 'my_action_name'
    end
  end
end

In users_mailer.rb I have:

class Users::Accounts < ActionMailer::Base
  default_url_options[:host] = "test_name_site.com"

  def account_delete(account)
    @account = account
    @action_url = users_account_url(:controller => "users/accounts", :action => "my_action_name")
    ...
  end
end

When in the controller I try to do this:

@account = Users::Account.find(params[:id])
Users::Accounts.account_delete(Users::Account.find_by_id(@account.id)).deliver

I get this error:

ActionController::RoutingError (No route matches {:action=>"my_action_name", :controller=>"users/accounts"})

How I can solve that?


In users_mailer.rb I tryed also

# the difference is: from 'users_account_url' to 'users_accounts_url'
@action_url = users_accounts_url(:controller => "users/account_authentications", :action => "confirm_account_authentication_delete")

# the difference is: from 'users_account_url' to 'url_for'
@action_url = url_for(:controller => "users/account_authentications", :action => "confirm_account_authentication_delete")

but it doesn’t work.

  • 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-20T00:59:03+00:00Added an answer on May 20, 2026 at 12:59 am

    You are not specify an ID of a record in users_account_url
    try this

    @action_url = my_action_name_users_account_url(account)
    

    http://0.0.0.0:3000/users/accounts/1/my_action_name

    Routing gude

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

Sidebar

Related Questions

I'm looking at ways to deploy a Ruby on Rails app (running on JRuby)
I am running OS X 10.5, Ruby 1.8.6, Rails 2.1, sqlite3-ruby 1.2.2 and I
i've developed small web app for personal use with Ruby on Rails. Now when
I am running Ruby and MySQL on a Windows box. I have some Ruby
I am running ruby script/generate scaffold or ruby script/generate model and I know the
When running tests in Ruby's unit::test framework, is there a really easy way to
When I'm running a simple Ruby script, what's the easiest way to dump an
Is there an easy way to tell if a ruby script is already running
Running a rails site right now using SQLite3. About once every 500 requests or
I'm learning Ruby on Rails with the AWDR book and have had to be

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.