search for: jrhicks

Displaying 10 results from an estimated 10 matches for "jrhicks".

Did you mean: bricks
2006 Jan 05
3
ActiveRecord setting IDs on auto increment fields
...auto_increment, `industry_id` int(10) unsigned default NULL, `risk_id` int(10) unsigned default NULL, `created_on` datetime default NULL, `updated_on` datetime default NULL, PRIMARY KEY (`id`) ) TYPE=InnoDB; the code in question is almost directly ripped from this tutorial: http://jrhicks.net/Projects/rails/has_many_and_belongs_to_many.pdf def update ... if @params[:risk_id] @industry.risks = Risk.find(@params[:risk_id]) if @params [:risk_id] else @industry.risks.clear end ... end and the error looks like this- NOTICE the `id` field getting set to 3.....
2006 Feb 20
1
belongs_to, has_one, has_many question (again?)
...#39;'m actually looking for some page which spills out the relations or associations within Rails, like: 1:1 relation: has_one, belongs_to in such and such way 1:many relation has_many, belongs_to in such and such way many:many relation: already has a tutorial of it''s own! (http:// jrhicks.net/Projects/rails/has_many_and_belongs_to_many.pdf) Thanks, Tom
2006 Jan 30
1
Running Rails Tests in Eclipse Test::Unit GUI
Maybe this is common knowledge, I don''t know. I figured I''d post it, hopefully it can help some people. If anyone has a better way, please share. http://jrhicks.net/120 (not my blog, I''m Mike in the comments I couldn''t get it to literally run the test in the identical way as rails does when you type rake. However, I could get it to run an individual test file in the GUI, by opening the file and picking Run As Test::Unit Test off the m...
2006 Mar 24
1
Has and belongs to many ... howto in the view?
I have a project, it has members. I have the data modeled, the ActiveRecord setup but I''m running into a block as how to accomplish this in a view. I would like if when the Project is being edited to present a list of all users, and then have a checkbox beside each name. Those selected would be a member, those who are not, obviously would not be. I am, however, not closed to
2006 Mar 26
3
Making a custom selection form - newbie
Hello all, I''ve been working with Ruby on Rails for a few weeks now. It''s difficult for me because I don''t have much experience with Ruby, Rails, MySQL, or any other web-languages. But I''m trudging on and learning a lot. I''ve been working on a web application for my dad''s website; it''s a simple content manager for
2006 Jul 02
2
Problems implementing a N:M table that contains actual data
Hi everyone, I''m currently finishing the planning phase of a small project I want to create. I read a bunch of tutorials about ActiveRecord and the different way to link your "tables" with belongs_to, has_many, has_and_belong_..., etc... However I''m stillnot sure if what I''m trying to do will work *well* with ActiveRecord. So enough talk,
2006 Jul 11
4
checkboxes with a has_many :through relation
All, I''m populating a view with checkboxes in a list. I want to be able to assign to my has_many relationship using the post values of these checkboxes. Essentially, I want to populate the relationship table which will create the correct join values in my model. Here is my check_box_tag code: <%= check_box_tag("@current_job[target_list_ids][]",
2006 Apr 10
4
Many To Many''s Join table attributes + migrations
...-a-rounds in progress. Any ideas? I''ve seen the following article but it doesn''t go into enough detail and straight away bypasses the abstract migration tool using instead database specific sql (which suggests that the built in features may not exist for this yet): http://jrhicks.net/Projects/rails/ has_many_and_belongs_to_many.pdf On a similar note: How does rails handle the plural expansion of words like ''category''. i.e., if you have a migration called categories is it going to correctly use the singular for the model? That kind of naming scheme...
2006 Apr 11
5
multiple select_tag
Hello again, I have a table called line_items, with the following fields: id int item_name varchar() qty int conditions text I''ve made my LineItem model, and everything works as such (with simple text_fields).. Now I''d like for the conditions field to be a select_tag() with multiple choice possibility. I''m guessing I need some code to expand/restract the array for
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
I''m working on a simple CMS. The main data type are "listings" a listing habtm (has_and_belongs_to_many) categories and subcategories. Subcategories belong_to categories. Subcategories are basically the same as categories, but they are treated differently in a few situations. The problem is, I can''t seem to write the view/controller/model code that allows me to