DISQUS

DISQUS Hello! Thinking inside a bigger box is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

Rails intro #2: One-to-many relationships

Started by jhannes · 10 months ago

In my last article, I showed you how to get started with your Rails application. The result of the simple commands, rails blogdemo; cd blogdemo; ruby script/generate scaffold article title:string author:string content:text; rake db:migrate; ruby script/server was that you had ... Continue reading »

2 comments

  • i get the following error on step 2on updating the controller

    app/controllers/comments_controller.rb:89: formal argument cannot be an instance variable

    def find_article
    @article = Article.find(params[:article_id])
    end
  • Hi, Keik

    I don't get the same error, and I'm wondering if you might've made a mistake in copying the code. The error message is something you get if you say

    def method(@param) ...

    Or

    do |@param| ...

    or

    { |@param| ...

    Is it possible that you have an extra "(" after "find_article"?

Add New Comment

Returning? Login