Hey all,
I keep getting a syntax error somewhere in this code. Thanks for all
help.
class StudentState < ActiveRecord::Base
has_many :students
end
class Student < ActiveRecord::Base
belongs_to :student_state
named_scope :filtertabs, :join => :student_state, lambda { |*args|
{:conditions => {'student_state.id => ?', args}} }
end
class StudentsController < ApplicationController
before_filter :get_status
def index
@list = student.find(:all)
render :xml => @list
end
def filter
@students = @student_state.students.filtertabs.find(:all)
render :xml => @students
end
def get_status
@student_state = StudentState.find(params[:id])
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.