similar to: One model class per file?

Displaying 20 results from an estimated 20000 matches similar to: "One model class per file?"

2006 May 24
0
Routes recognition problem
Hiall, I have two modules for my controllers containing the following files /app/controllers/admin/new_controller.rb /app/controllers/admin/list_controller.rb /app/controllers/admin/sidebar_controller /app/controllers/community/input_controller.rb /app/controllers/community/sidebar_controller.rb Each of those controllers is declared with the appropriate module like so class
2006 Jun 14
5
InstantRails Lost connection to MySQL server
Hiall, I just tried out InstantRails version 1.3a. After a virgin install and filling the fresh mysql db with my app schema, I tried runningthe app with webrick, only to see the infamous "Lost connection to mysql server" for every action. What is it that I''m doing wrong? I also have mysql 5 installed on my machine, but the service is stopped while experimenting with
2006 May 01
7
ActiveRecord and Database Views
Hiall, If I have say 10 tables that i would like to wrap up in 1 view to manipulate data inside these tables, do I then need 10 model.rb files for all 10 tables plus 1 for the view, or do I just need 1 model.rb file for the view ? cheers Martin
2006 Apr 18
7
Connecting to multiple databases
Hi Everyone, I am trying to connect to multiple databases and followed along the Recipe in Chad Fowlers ''Rails Recipes'' book (which basically is about establishing the connection in a subclass of ActiveRecord::Base, and inheriting all classes in need of this connection from this class) Chad Fowler says: "You won''t be able to instantiate an External, of course,
2006 May 18
6
Form actions with additional parameters
Hiall, I want to give the action of a form an additional parameters but can''t figure out how to do it. My code looks like this <%= start_form_tag :action => ''create'', next_step => true %> <%= render :partial => ''user_form'' %> <%= render :partial => ''community_form'' %> <%= submit_tag
2006 May 14
6
file and directory layout below app/models
Hiall, Is it possible to organize my model files below app/models into subfolders? E.g. I would like to put admin related models into their own subfolder. This kind of structuring works for controllers and views (scaffolding creates the right subfolder-model mappings), but app/models always stays flat. I''d really like to be able to group my code into logical, well packages :-) Yes, I
2006 May 22
15
collection_select default selected value
Hiall, Unfortunately I just can''t find out how to setup a default selected value when using collection_select. My call is like so: <%= collection_select(:consultant, :lastname, @consultants, :id, :lastname, { :selected => @current_consultant.id } ) %> which is not working, I debugged so far that I know that @current_consultant.id contains the correct value. Any tips? cheers
2013 Feb 04
1
[LLVMdev] [PATCH] Coding standards: don't use ``inline`` when defining a function in a class definition
On Mon, Feb 4, 2013 at 1:31 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote: > On Wed, Jan 30, 2013 at 1:08 AM, Dmitri Gribenko <gribozavr at gmail.com> > wrote: > > Hello, > > > > This came up on IRC in context of r173842, and it was suggested to > > codify this unspoken rule. > > > > Current practice is not to use 'inline' in:
2006 Apr 18
2
Connecting to multiple databases with multiple database users
Hi everyone, I was wondering what the common practice for handling multiple db users with fine grained privileges on multiple databases is. Against the often read guideline for rails users to keep with a single db as "more dbs don''t really make sense anyway", my opinion is that it DOES make sense to use more than one db schema for a number of reasons that I won''t
2006 May 14
4
script/console on windows
Hiall, When I try to run script/console from a windows command line like f:\rails_app\ruby script\console I get the following error: F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__'': no such file to load -- initializer (LoadError) from F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require''
2006 May 18
3
ActiveRecord after save new and old values
I want to write a function that after an ActiveRecord saves successfully, can show me what the before and after values of a particular column are. Is this possible without creating a separate object before modifying the current one? -John
2006 May 23
3
image_tag problem
Hiall, I want to make an image_tag from within a controller in order to be able to present a link (with a status image) in a view. Here is my controller method (in file webca_controller.rb, hence WebcaController) def untouched_status_image_tag image_tag("open", { :alt => "Offen", :title => "Offen", :size => "12x12", :class =>
2004 Sep 17
4
Guaranteed rate per class and maximum ceiling per element in class???
Hi all, It is my understanding that with HTB, the rate and the ceiling are divided over the elements of the class. E.g. using a rate of 100 kb and a ceiling of 2000 kb for a class with 10 elements on a 100Mb NIC, the effect of the ceiling will be that if all elements are generating their maximimum possible trafic they will be effectively limited to ~ ceiling / number of elements, in this case
2006 Dec 24
0
How to classify packets per host on same class
Hi Ive been reading, testing and applying what Iam reading in the LARTC tutorial for a couple of days, I do not wish to use ready made scripts because that means I will always come back and ask the same question again. So Ive been wondering if I have 10 computers and I do want to limit the download for each of those 10 computers to 10 kbyte per second. I would create a leaf class and match the
2009 May 12
0
triangle.class pch per factor
Hello, I am using triangle.class in ade4 package and a factor. I would like to use this graphic parameter (pch) to set a different kind of point for each group in my factor (lakes). I have tried pch=1:4, I guess it does what it is supposed to do but not what I want. I can't use colors. Thank you in advance, -- View this message in context:
2006 Sep 29
0
[PATCH 2/6] xen: add per-node bucks to page allocator
This patch adds a per-node bucket to the heap structure in Xen. During heap initialization the patch determines which bucket to place the memory. We reserve guard pages between node boundaries in the case that said boundary isn''t already guarded by the MAX_ORDER boundary to prevent the buddy allocator from merging pages between nodes. -- Ryan Harper Software Engineer; Linux Technology
2006 Apr 27
5
Realtime Form Validation Plugin Available
Granted, I''m still very much a newbie, but after reading an article on AJAX that basically states at one point that just because you can use AJAX doesn''t always mean you should, I have to ask: Why bother contacting the server (even if it is an insignificant amount of bandwidth) to validate the sanity of form data (unless you''re actually validating against something in
2012 Nov 04
1
sample equal number of cases per class
Dear community I have a dataframe and want to split it into a learn and a test partition. However the learnset should be balanced, i.e. each class should have the same number of cases. I tried and searched a lot, without success so far. Maybe you can help? Some example code *# generate example data df <- data.frame(class = as.factor(sample(1:3, 20, replace = T)), var1 = rnorm(20,3), var2 =
2006 Nov 16
4
HTB prio: global or per class ?
Hi all, Is the prio specification in the htb class global or is it on a per class basis ? A simple example: class 1:10 parent 1: class 1:100 parent 1:10 prio 3 class 1:200 parent 1:10 prio 7 class 1:201 parent 1:200 prio 1 class 1:202 parent 1:200 prio 2 Which class will get excessive bandwidth first? 100 or 201/202 ? _______________________________________________ LARTC mailing list
2006 May 18
4
Can I send rendered .html to somewhere besides the web server?
Is there any way to tell Rails to send the .html file it renders somewhere other than the web server? I need to save a page to the server''s file system instead of sending it to the user''s browser. Thanks! Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060518/facce47e/attachment.html