Not sure if you noticed the typo. Its ActiveRecord::Base (the d was
missing in the answerer's post).
-- Raja
Helder Oliveira wrote:
radhames brito wrote:
class Game ActiveRecor::Base
has_many :teams
class Team ActiveRecor::Base
belongs_to :game
call designation of a game like
Adrien Nom wrote:
Hi,
I would like to return a combination of named scopes in a named
scope :
For example, I have a named scope filter and I want to add a named
scope eval_filters like
Product.eval_filters(['x','y','z']) is equivalent to
Product.filter('x').filter('y').filter('z')
badnaam wrote:
How can I render a show action on certain conditions?
def show
@post = Post.find_approved
if @post.approved
approved = true
end
respond_to do |format|
# I only want to render show.html.erb if approved is true if not I
would like to redirect the user back
Rodrigo Felix wrote:
I've been facing a problem when generating a model (or controller, ...).
I'm
using rails 2.3.8 and ruby 1.8.7.
Has anybody been facing anything like this?
Do you have 2 instances of TempFile (tempfile.rb) or DelegateClass
(delegate.rb) ? Googling around seems to suggest
Abel wrote:
I always get confused when I have to make a search with Active Record
a little beyond the most ordinaire. How do I find the record that was
updated the last?
It has to be something like
Ad.find :conditions = updated_at = :last
How about
Ad.find :first, :order = 'updated_at
Hmm, not sure what you are missing, seems fine to me.
irb(main):001:0 f = File.new('test.txt')
= #File:test.txt
irb(main):002:0 f.each_line do |line|
irb(main):003:1* w = line.split(' ')
irb(main):004:1 puts w
irb(main):005:1 end
First
Second
Third
= #File:test.txt
My file had First, Second
Jay Pangmi wrote:
Hi, I have two combo boxes. One combo box has the name of countries
stored in the database. So, when a country is selected from this combo
box I want other combo box to list all the cities stored in the database
related to that selected country without clicking any button.
Couple of things
a) Your stylesheet is called complete.css but your stylesheet_link_tag
says example ?
b) Check your logs as you type to see if rails fires off queries
depending on your input.. The autocomplete method is doing a find
which should be firing off SQLs in ur log file. You would
Jon Stenqvist wrote:
Hi,
I'm not sure i'm my design is correct, but i have around_filter in the
controller, where i want to add a small javascript at the end of the
page. Is there someway i can use the javascript_tag from the controller?
i though there where a helpers proxy available.
9 matches
Mail list logo