Displaying 3 results from an estimated 3 matches for "find_all_by_status".
2005 Apr 20
7
find_all_by and :order
I think I must be missing something obvious...
I have...
class OrderController < ApplicationController
model :order
scaffold :order
def list
@orders = Order.find_all_by_status(@params[:status], :order => "date" )
end
end
class Order < ActiveRecord::Base
belongs_to :customer
end
and i''m getting...
/Unknown column ''orderdate'' in ''order clause'': SELECT * FROM orders
WHERE status = ''New'' O...
2006 Apr 24
8
Application Design
I have a question about how to implement a design in Rails. I will try to make this as easy to follow as possible. First, let''s say that I have an ''Orders'' table that has different statuses. The 3 statuses that I want to track are ''Submitted'', ''Approved'', and ''Purchased''.
I also have 3 users of this application.
2006 Aug 08
11
Newb question- method not working
I know this shouldn''t be in the view but to test the code it is.
Anyway if I do just session[user] I get back the user id (the id from
the user table)
which is good.
However this code does not work.
<% a = session[:user] %>
<% uname = User.find(:first, :conditions => id = a) %>
<%= @uname %>
TIA
Stuart