similar to: [AWDwR] Confused about has_one and has_many

Displaying 20 results from an estimated 900 matches similar to: "[AWDwR] Confused about has_one and has_many"

2007 Dec 13
10
Version naming to use in a RoR proyect
Hi everyone, I would need to know if RoR follow any policy for version naming; I mean, something like linux´s kernel does or similar. For instance, kernel uses numbers separated in groups by dots (i.e. pre 2.6 - AA.BB.CC). These groups mean differents fixtures, bugs fixed... I will start a big proyect from scratch with rails and I want to choose now a standart to use and avoid future problems
2006 Jun 19
12
AWDWR- Question
I''m having a particularly difficult time undersanding one lesson from this book. This is in relation ot how one would grab "search" parameters from web forms to search for records in the database. I understand the :conditions part of find() but am confused on the code: 1- name = params[:name] pos = Order.find(:all, :conditions => ["name = ? and pay_type =
2007 Feb 12
6
Cannot send_file then delete it
My application accepts a form to create multiple large(100''s of MB) temporary files and then zip''s them up to send off to a user. I have the files constructed, and the zipping working. The problem is that if I use send_file to send the zip off to the user, I cannot delete the file afterwards as it seems send_file forks off another process and deletes the file before the
2006 Aug 03
1
OT: Tables and Rails code
This might be off topic, not entirely sure. Basically I''ve created a table to return data and it seems that the column headings repeat along with the entries. So perhaps it''s where I''m placing the code and not so much my HTML. Ideas, solutions appreciated: <h1> Current job openings</h1> <% for position in @positions -%> <div
2007 May 11
3
is_active?
Hey all, i''m rather new to rails and was curious if ActiveRecord implemented anything like is_active where the delete functions would just mark records as inactive, vs deleting rows. (similar to created_at, etc). I need a history of transactions, and this is how I would code in other languages. Any advice? Is there are smarter way to implement this? Thanks in advance! -- Posted via
2006 Oct 07
2
Proxying Apache to Mongrel, not sure if Apache is serving up static files
Let''s try this one... I have Apache 2.0.55 set up and also have Mongrel set up. I have Radiant set up running under Mongrel, and have Apache proxying to the Mongrel instance. That all seems to be working fine. I thought I''d modify the settings a bit to let Apache serve up the static files - images, stylesheets, etc. I have it set up, and am not getting any errors. However.
2007 Jul 23
4
RoR Postion. Full time, Utah
We have 2 positions open for experienced ROR programmers. If you feel like you are a experienced ROR programmer and are looking for a full time position, please send over you resume. You must be willing to re- locate. No contract jobs. We have an in house team and have only 2 positions left. Starting Salary DOE. $30,000-$60,000 with housing, full benefits, 401k, paid vacation, ext. Don''t
2007 Jan 12
2
Forking a process in Rails is messing up mongrel
I''m trying to run an external Ruby script from my Rails app. To do this i''m using this function def fork_with_new_connection(config, my_class = ActiveRecord::Base) pid = fork do begin my_class.establish_connection(config) yield ensure my_class.remove_connection end end Process.detach(pid) end Then, within my controller I do this:
2007 Jan 13
6
nice date function
Hi: you know the way the google and this forum presents dates? How it''s measure from the current date/time and presents nicely as "39 minutes ago", 2 days ago, etc.? Has anyone done a gem or other library object that I can get to do those types of dates? Thanks so much in advance! Mike -- Posted via http://www.ruby-forum.com/.
2007 Jan 22
2
caches_action :index for site root gets propagated to lower levels (how to stop?)
Hello all, I am running a blog system which has its "/" (home page) cached like this: class ApplicationController < ActionController::Base before_filter :index_cache_expirer, :only => [:index] caches_action :index so the site''s top page is caches for 60 seconds in my case (index_cache_expirer is a home-made function to expire) on the site, there is also a
2007 Feb 16
4
Ideas for rails
Here are a few suggestions, wondering what others thought: When you generate a model for a DB table, it would be nice if the model.rb contained the DB schema (kind of like # commented out schema) right in the model file. This would make reference WAY easier and put all of the DB stuff in one easy file. Thanks. also nice, of course, woudl be for rails to try and ''guess'' the
2006 Dec 11
4
creating a cache in rails
I need to create a small hash of values that persists across requests in Rails. I cannot store this information in the database or filesystem and only want to do it in memory. I was looking for a simple solution to implement this and read somewhere that memcache is pretty much overkill. This app is only running on one server so putting in memory should be just fine. I''m very new to
2007 Nov 05
3
link_to & others really necessary?
One of the areas where I think Rails goes too far is in many of the helpers that (AFAICT) do nothing more than change the syntax used to write simple HTML tags. link_to and many of the form tags come to mind. For me, these helpers aren''t that helpful. I find the HTML much clearer to write and read, I don''t see any added value in the overhead costs of using code to
2006 Oct 17
8
Is it possible to make an online poker clock with ruby ?
I''m just starting to learn ruby and i wanted to set some projects for myself the 1st of which is a poker clock running online, but before i start trying to do it i would like to know if it''s possible. I dont want to waste my time if it''s not possible at all. Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You
2006 Nov 28
11
New Rails Site: Wordie
My latest stupid web trick, built, with love, in Rails: http://wordie.org Make lists of words. See who else likes the same words. Basically, it''s a dating site. Built on thanksgiving while half-watching football and launched yesterday. In other words, half-baked, but I thought some of you might find it mildly amusing. John ____________________________ John McGrath Squirl: a site for
2007 Oct 04
10
Design and modeling tools?
What do you guys use for design and modeling (and don''t answer pen and paper, because I use those to, they just don''t look so good in a project report ;) ) I have tried stuff like UMLet (free), Altova UMLsomething (pay), dia (no comprende ;) ), NetBeans UML (slow). But none worked just the way I wanted them to. Any suggestions? Christian...
2006 Feb 07
1
AWDWR: NameError (uninitialized constant UnknownAction) in rescue_action_in_public
I copied (and modified) this code from AWDWR: def rescue_action_in_public(exception) case exception when ActiveRecord::RecordNotFound, ActionController::UnknownAction render :template=>''/error'', :layout=>''application'', :status=>''404 Not Found'' else render :template=>''/error'',
2008 Mar 01
2
No route matches with {:method=>:get} Error in AWDWR Book
Hi I''m working on the AWDWR book and I''m on the admin section of the book. I have rails 2 installed on my machine and I have ran into an error when I created my controller login but when I go to http://localhost:3000/login/index I get this error: No route matches "/login/index" with {:method=>:get} I haven''t touched the routes.rb file and when I generated
2006 Nov 04
0
New version of the AWDwR beta book available
I''ve uploaded the B1.12 version of AWDwR. The major changes include: - Justin Gehtland''s new chapter on Web 2.0 - James Duncan Davisdon''s chapter on deployment (this is an interesting one---JDD has strong opinions on how a Rails application should be deployed, and the chapter mirrors this. You''ll find it short and easy to follow). - I changed the
2006 Aug 14
1
AWDWR Chpt6: Webrick Get...200... then ...500...
Hi, Rails produces to diff Gets on the Webrick: AWDWR Chpt 6 strange results: First browser call to /Admin shows correct form; - And WEBrick reports: "Get /admin HTTP/1.1" 200 485 - -> /admin Subsequent browser calls to /Admin show: NoMethodError in AdminController#index undefined method `each'' for #<Mysql:0x37aba80> - And WEBrick reports: "Get /admin