Select box problems

Hi all,

I am trying to get a select box to choose the type of goal records to
display using the scope field. I keep getting a " NoMethodError in
Admin#list" on line 8 “undefined method `scope’ for

The code from list.rhtml is

<%= start_form_tag :action => ‘list’ %>

View goals by scope: <% options = [["Select the Goal's Scope", ""]] + Goal::GOAL_SCOPES %> <%= select("goal", "scope", options) %> <%= submit_tag 'Go' %>

<%= end_form_tag %>

and the list method is

def list
log =
log.level = Logger::DEBUG

@goal = params[:goal]
if @goal != nil

   #@goals = Goal.find(1)
   @goals = Goal.find(:all, :conditions => ["scope = :scope", 

@goal_pages, @goals = paginate :goals, :per_page => 10

The goal.rb is:

class Goal < ActiveRecord::Base
validates_presence_of :goal
validates_uniqueness_of :goal
acts_as_tree :order => “goal”

GOAL_SCOPES = [[“Lifetime”, “Lifetime”], [“This Year”, “This Year”],
[“This Quarter”, “This Quarter”], [“This Month”, “This Month”], [“This
Week”, “This Week”]].freeze


It seems that this is just a simple problem, but I am very new to rails,
any help is much appreciated



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs