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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:22:48+00:00 2026-05-28T01:22:48+00:00

I was creating a scaffolded class on rails and then I tried to access

  • 0

I was creating a scaffolded class on rails and then I tried to access it’s “new” action but i got this error:

 NoMethodError in Medias#new

 Showing /Users/webcloud/Documents/Trabalhos/Reinaldo/Residencial/gerenciador/rails_estate/app/views/medias/_form.html.erb where line #1 raised:

 undefined method `media_index_path' for #<#<Class:0x007fbfdc371bf0>:0x007fbfdc36b6d8>
 Extracted source (around line #1):

 1: <%= form_for @media, :html => {:multipart => true} do |f| %>
 2:   <% if @media.errors.any? %>
 3:     <div id="error_explanation">
 4:       <h2><%= pluralize(@media.errors.count, "error") %> prohibited this media from being  saved:</h2>
 Trace of template inclusion: app/views/medias/new.html.erb

 Rails.root: /Users/webcloud/Documents/Trabalhos/Reinaldo/Residencial/gerenciador/rails_estate

 Application Trace | Framework Trace | Full Trace
 app/views/medias/_form.html.erb:1:in `_app_views_medias__form_html_erb___3954857503624418674_70230991238020'
 app/views/medias/new.html.erb:3:in `_app_views_medias_new_html_erb__3813674121976191732_70231004981260'
 app/controllers/medias_controller.rb:34:in `new'

the weird part is that it have the resource configured:

 resources :medias

And it’s model is using the carrierwave gem to manage uploads

class Media < ActiveRecord::Base
  has_many :gallery_data
  has_many :galleries, :through => :gallery_data
  belongs_to :user
  belongs_to :category
  attr_accessible :file_name, :remote_image_url
  mount_uploader :file_name, ImageUploader
end

It’s controller method (new) is just the same as any scaffolded method:

  # GET /media/new
  # GET /media/new.json
  def new
    @media = Media.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @media }
    end
  end

I don’t really know what’s going on here.

  • 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-28T01:22:49+00:00Added an answer on May 28, 2026 at 1:22 am

    See this answer for your solution.

    To summarize, ‘media’ is pluralized ‘media’, not ‘medias’ as you have put.

    $ rails console
    > 'media'.pluralize
     => "media"
    

    You’ll need to change your routes.rb (and maybe some other code such as controller class names) in order to correct the problem.

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

Sidebar

Related Questions

I tried creating a DB migration in Rails that looked something like this: ruby
Creating a class at runtime is done as follows: klass = Class.new superclass, &block
Error creating bean with name 'sessionFactory' defined in class path resource [ApplicationContext.xml]: Invocation of
I am new to rails so excuse the simple questions. I am creating a
I'm new to Heroku. I tried pushing a simple test Rails 3.1.1 app to
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
I'm new to rails and building a small test app on rails3 (beta4). I
Im creating a model with the line rails g scaffold contact firstname:string lastname:string email:string
Steps to produce this: prompt>rails test_app prompt>cd test_app prompt>script/generate scaffold date_test my_date:datetime prompt>rake db:migrate
I am creating a blog in Rails using Scaffolding. I want to add a

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.