DISQUS

Thinking inside a bigger box: Rails intro #2: One-to-many relationships

  • keik · 1 year ago
    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
  • Johannes Brodwall · 1 year ago
    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"?