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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:36:49+00:00 2026-06-02T12:36:49+00:00

I am trying to namespace my site into owner / admin, and hitting a

  • 0

I am trying to namespace my site into owner / admin, and hitting a routing error. When I try to create a new Financial Report (http://localhost:3000/en/admin/financial_reports/new)
I get

No route matches {:controller=>"financial_reports", :format=>nil}

Here is my routes.rb (shortened)

scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do
 root :to => 'sites#index'
 get "logout" => "sessions#destroy", :as => "logout"
 get "login" => "sessions#new", as: "login"
namespace :admin do
    root :to => "base#index"
    resources :financial_reports do
      collection do
        get :monthly
        get :yearly
      end
    end
  end
namespace :owner do
    root :to => "base#index"
  end
match "*path", to: "sites#not_found" # handles /en/fake/path/whatever
end
root to: redirect("/#{I18n.default_locale}") # handles /
match '*path', to: redirect("/#{I18n.default_locale}/%{path}")
end

Here is my controller
app/controllers/admin/financial_reports_controller.rb

class Admin::FinancialReportsController < BaseController

def index
@financial_reports = FinancialReport.all
end

def new
@financial_report = FinancialReport.new
end

def create
@financial_report = FinancialReport.new(params[:financial_report])
if @financial_report.save
flash[:notice] = ‘Financial Report Uploaded Successfully’
redirect_to root_url
else
flash[:alert] = “Financial Report not uploaded successfully”
render “index”
end
end
def yearly
@financial_reports = FinancialReport.yearly
end
def monthly
@financial_reports = FinancialReport.monthly
end
end

and my view

app/views/admin/financial_reports/new.html.erb

<%= form_for(@financial_report) do |f| %>
<p>
  <%= f.label(:report_type) %> <br>
  <%= f.radio_button :report_type, "Monthly" %> Monthly |
  <%= f.radio_button :report_type, "Yearly" %> Yearly
</p>
<p>
  <%= f.file_field :file %>
</p>
<p>
  <%= f.submit "Upload Monthly Record" %>  
</p>
<% end %>

Any idea why i’m getting this error? Thanks

  • 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-02T12:36:52+00:00Added an answer on June 2, 2026 at 12:36 pm
    <%= form_for[:admin, @financial_report] do |f| %>
    ........................
    .............
    ........
    

    http://guides.rubyonrails.org/routing.html

    Rails Namespace vs. Nested Resource

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

Sidebar

Related Questions

I am trying to enable a new theme on a site running Drupal 6.16.
I'm trying to create an admin backend for a cms. So I have a
I'm trying to create a javascript error logging infrastructure. I'm trying to set window.onerror
I'm trying to learn how from this site http://msdn.microsoft.com/en-us/library/cc265158(v=vs.95).aspx but the code won't compile
I am trying to create a PowerShell script that creates a new IIS 6
I am trying to follow this guide to use Facebook on my site: http://www.deviantcoders.com/articles/aspnet-membership-and-role-provider-facebook-connect-part-2
I'm trying to change a namespace in Visual Studio. My folder structure looks something
I'm trying to develop a custom spring namespace that works like the built-in 'p'
I am trying to find all of the types in the Models namespace within
I'm trying to figure out how XSLT process namespace prefixes and have following example:

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.