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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:24:41+00:00 2026-06-09T20:24:41+00:00

Ruby, Rails 3, newbie I am extending a working Rails application (displays movies) for

  • 0

Ruby, Rails 3, newbie

I am extending a working Rails application (displays movies) for a class assignment, so the basic plumbing works OK.

I added an entry to routes.rb –

match "/movies/directed_by/:director" => "movies#directed_by"

my rake routes then has an entry

/movies/directed_by/:director(.:format) {:controller=>"movies", :action=>"directed_by"}

notice there is no “path”, nor HTTP method (e.g. GET) specified

For the other (Rails Model auto-generated) routes, paths and verbs are specified.

I have a controller method

def directed_by

  # some code

end

I have a View file ../app/Views/show.html.haml where I added

= link_to 'Find Movies With Same Director', directed_by(@movie.director)

which throws a runtime error –

NoMethodError in Movies#show

Showing /home/saasbook/hw3/hw3_rottenpotatoes_rjf/app/views/movies/show.html.haml where line #22 raised:

undefined method `directed_by' for #<#<Class:0xc564594>:0xc532198>

So my question is, now do I tweak my routes.rb and/or view haml to get everything tied together?

All hints welcomed.

  • 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-09T20:24:42+00:00Added an answer on June 9, 2026 at 8:24 pm

    In routes:

    match "/movies/directed_by/:director" => "movies#directed_by", :as => :movie_direct_by
    

    Then in your view:

    = link_to 'Find Movies With Same Director', movie_direct_by_path(@movie.director)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a complete newbie in working with a Ruby on Rails (RoR) application.
I am a newbie to Ruby on Rails . I have started working on
I am a ruby and rails newbie. And I am working on a rails
I am newbie to ruby and rails for several months now.I took a class
i am newbie to Ext Js..i am working on ruby on rails... can any1
I am a newbie in Ruby on Rails. In a Rails application, I saw
I a newbie trying to write a [Ruby ON Rails] spec to make sure
I am facing Following problem, since i m a newbie to ruby on rails
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
I'm a Ruby on Rails newbie. I'm learning Rails in my spare time (my

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.