bluetechnx
June 29th, 2005, 01:24 PM
ok, so i have like a total of 4 tables in a database with like 3 join tables...
the 4 tables all have a controller for each to do CRUD operations on the tables. I am currently trying to add a sort() method to a controller to do the following to the section table:
#in manage_section_controller.rb
def sort
@result = Section.find(:all, :order "building, room, instructor_id")
end
#in sort.rhtml
# plz excuse if <%= and <% are off...im rush typing..
<%= for row in @result %>
<% puts row %>
<%= end %>
But, when I load the page I get a "Not Found" error...
is this some sort of persistence issue? where I need to tell Rails in Application.rb what models need to be remembered with like:
model :section
model :user
any insights are welcome...
One last question, any controller has visibility to all models right? or am I wrong on that belief?
the 4 tables all have a controller for each to do CRUD operations on the tables. I am currently trying to add a sort() method to a controller to do the following to the section table:
#in manage_section_controller.rb
def sort
@result = Section.find(:all, :order "building, room, instructor_id")
end
#in sort.rhtml
# plz excuse if <%= and <% are off...im rush typing..
<%= for row in @result %>
<% puts row %>
<%= end %>
But, when I load the page I get a "Not Found" error...
is this some sort of persistence issue? where I need to tell Rails in Application.rb what models need to be remembered with like:
model :section
model :user
any insights are welcome...
One last question, any controller has visibility to all models right? or am I wrong on that belief?