Thanks for taking the time to set me straight.
I confess that I did not look at the API. I have a hard time
navigating the API and sometimes avoid it when I really should be
looking there first.
As a result of your comment, I did find this link:
http://railsapi.com/doc/rails-v2.3.5/
It is a sea
Import has_many IRows
IRow belongs to Import
@import = Import.find(params[:id])
Shouldn't both of the following statements work the same?
#1 :@i_rows = @import.i_rows(:order => :row_sort)
Generates: SELECT * FROM "i_rows" WHERE ("i_rows".import_id =
4)
#2 @i_rows = IRow.find_all_by_import
Club has many Members
Person has many Members
Members belong to Club, Person
>
> What are the relationships between the models (has_many, belongs_to and so
> on)?
>
> Colin
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to t
Finally figured out something that worked.
@club = Club.find(params[:club_id])
ids = @club.members.connection.select_values('SELECT person_id FROM
members')
@people = Person.all(:order => 'name_sort',
:conditions => ["id NOT IN (?)",
ids])
Any comments or be
Kind of new at this and have been unable to find an example of what I
want to do.
I have three models, people, clubs and members.
@members = @club.members.all --> finds all club members
How do I write a find of all people that are not members of @club
Thanks
--
You received this message becau
I created an index with person_id and club_id but I can't figure out
how to properly access it (doesn't show up in the find_by... lists)
Can someone provide me a sample find statement to best use this index
Thanks.
class CreateMembers < ActiveRecord::Migration
def self.up
create_table :mem
Thanks for your ideas.
I decided to make per_page an attribute of the user and set it at
login. That way it gives all my list pages a common look.
I had already put this inside a form_tag I am using for a search box,
so I didn't want to add another form_tag. The search box and the
pagination boxe
Ok, I tried as you suggested with:
<%= select_tag(:per_page, options_for_select(%w{10 20 30 40 50},
selected = session[:per_page]), :onchange => "session[:per_page] =
this.value") %> Lines per page
I can't seem to get the :onchange to set a new value for
session[:per_page]. I checked :onchange w
def self.per_page
20
end
Any suggestion on how I can calculate this value base on the size of
the browser window?
Thanks
--
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 rubyonrails-t...@googl
Thanks for the advice. Changing to a hash did what I wanted it to.
I can see the advantage of generalizing this in a model. Thanks for
the suggestion.
--
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
Hi,
I was trying to understand stored values vs display values.
# model code
CLUB_TYPES = [
# Displayed stored in db
[ "Public" , "pub" ],
[ "Village" , "vil" ],
[ "Private" , "pvt" ]
]
validates_inclusion_of :club_type, :in =>
CLUB_TYPES.map {|disp, value| value}
#view c
11 matches
Mail list logo