[Rails] Re: comparing data

2009-11-08 Thread Aljaz Fajmut
Colin Law wrote: > 2009/11/8 Aljaz Fajmut : >> >> How can you pass array of parameters to GET request? > > The same as anything else, eg > if @my_array contains [0,1,2] > <%= link_to 'Compare', :controller => 'compare', :action => > &#x

[Rails] Re: comparing data

2009-11-08 Thread Aljaz Fajmut
How can you pass array of parameters to GET request? Colin Law wrote: > 2009/11/8 Aljaz Fajmut : >> controller by post or by url? >> >> Any tips are highly appreciated. >> -- > > If I understand correctly you have records in the db and wish to > compare them

[Rails] comparing data

2009-11-08 Thread Aljaz Fajmut
Hello, I'm trying to implement Rails functionality which would allow to compare Model records (in my case different plans). I'm unsure what would be the proper approach towards this with Rails, is there any tutorial for doing something like available on internet/book? Which would be better: to

[Rails] Re: table inheritance in rails

2009-11-05 Thread Aljaz Fajmut
model. As far as I understand RoR approach: if I have a lot of duplicated code in my application, there must be some better solution for my problem. What do you think? Marnen Laibow-Koser wrote: > Aljaz Fajmut wrote: >> It might not be the best example but I couldnt think of better

[Rails] Re: table inheritance in rails

2009-11-05 Thread Aljaz Fajmut
It might not be the best example but I couldnt think of better one in the moment in wrote this. I have a clear image of what I want to implement. Is this single or multi-table inheritance? Thanks for help Marnen Laibow-Koser wrote: > Aljaz Fajmut wrote: >> Hello, >> >

[Rails] table inheritance in rails

2009-11-05 Thread Aljaz Fajmut
Hello, Suppose I have 2 models Human and Person and I want to inherit one from another so that I could use 'human' model/migration as a generic builder for smiliar objects as 'person', for instance this with the following table structure: human table: id weight size person table: id name surnam

[Rails] getting related object from the active record

2009-10-23 Thread Aljaz Fajmut
Hello. How do I access blog object/model from the following active record class: class Entry < ActiveRecord::Base belongs_to :blog def self.test puts blog.title end end In the example above I want to print the blog title. Thanks for help! -- Posted via http://www.ruby-forum.com/.

[Rails] Re: unit tests and fixtures

2009-08-14 Thread Aljaz Fajmut
Frederick Cheung wrote: > On Aug 13, 4:14�pm, Aljaz Fajmut > wrote: >> instead of >> >> def test_some_test >> � assert.. >> end >> > Either syntax works. > >> If I try to include/load the fixtures by using: >> � fixtures :sto

[Rails] Re: unit tests and fixtures

2009-08-13 Thread Aljaz Fajmut
Robert Walker wrote: > Aljaz Fajmut wrote: >> With my version of Ruby I have to define test with the following syntax: >> >> test 'some test' do >> assert.. >> end > > What do you mean by this? I don't think the Ruby version should have

[Rails] unit tests and fixtures

2009-08-13 Thread Aljaz Fajmut
Hello I'm experiencing some problems using rails fixtures with unit tests. With my version of Ruby I have to define test with the following syntax: test 'some test' do assert.. end instead of def test_some_test assert.. end If I try to include/load the fixtures by using: fixtures :stor