similar to: repeating has_many calls on the same model

Displaying 20 results from an estimated 900 matches similar to: "repeating has_many calls on the same model"

2006 May 18
1
ActiveRecord problems from within template
Hi, my Film model has this: has_many :live_action_personnel, :class_name => "Credit", :include => :credit_type, :order => ''credit_types.position, credits.position ASC'', :group => ''credit_types.personnel_type'',
2006 May 20
1
RJS returned javascript written straight to page
hi there, I have in my controller, the following to catch a link_to_remote: def form_part_add_personnel @credit_types = CreditType.find(:all) p = Credit.new() p.id = rand.to_s[2..-1] render :update do |page| page.insert_html :bottom, "script", :partial => ''films/form/personnel'',
2006 May 24
2
named routes confusion
Hi, I''m trying generate a URL from a named route like: namedroute_url(params...) but the generated route is always coming out as the first match from the routes table. The named route is defined inside a map.with_options block, but that shouldn''t matter should it? dorian -- -- I do things for love or money
2006 Apr 28
2
tests and login_engine
Hi there, I just started writing tests today after some months of using rails (slap wrists). I seem to be getting the hang of things, but I''m hitting a wall when it comes to functional_testing pages protected by login_engine/user_engine. all my assertions come back with: Expected response to be a <:success>, but was <302> Is there a way I can login from within a test?
2006 May 16
3
wondering how to do some clever DRYing up
Hi there, I''m now getting to the point in my rails app where I can use all of the nice basic features like AJAX and engines etc... but, I want to get my hands a bit dirtier, whilst learning to DRY up my code a bit. I''m using AJAX quite a bit to dynamically populate/edit/sort has_many relationships in forms, and consequently on a model with many has_many''s I end up
2006 Jan 23
2
require rmagick
Hello, I''m trying to use rmagick in a helper script (for auto-generating image sizes) and I''m not sure where I should be calling ''require''. currently I have: require ''RMagick'' at the top of my controller: class FilmsController < ApplicationController require ''RMagick'' but that''s giving me an error:
2006 Mar 29
1
load testing
hi, does anyone have any pointers for load testing an app running on apache2 with fastcgi? I have an app running circa 3000 page requests per day, most of which are static pre-cached files and fastcgi seems to be coping well so far (crosses fingers) but I would like to be able to work out my server limit. Currently I have the following in my apache conf: FastCgiServer
2006 May 09
1
name_url in tests
Hi there, I posted earlier asking about testing named routes in functional tests, but got no response, so I''m making my question less specific. It seems from the docs that it''s possible to to test named routes in cases such as: asserts_redirect_to name_url(:param => "whatever") but I haven''t seen any mention of it being used with any other tests and I keep
2006 Jun 07
1
railstidy
Hi there, anyone had any trouble with railstidy? I''m using it on 1.1.2 just to tidy my output and I get a server error everytime, but the only log message I get is: FastCGI: incomplete headers (0 bytes) received from server "/var/rails/dev/public/dispatch.fcgi" I have: after_filter :tidy def tidy RailsTidy.filter(response) end ...in my application.rb and I can get
2006 Jan 18
1
using unique varchar instead of id
Hi, I just signed up so ''hello everybody''. As the title suggests, I was wondering if there was an easy way to specify that I want all actions/controls to be based upon a particular parameter rather than :id (in this case :unique_name). I don''t :id to appear in URLs or elsewhere, I want it all to work from :unique_name. It seems like something that I should be able to
2006 Mar 24
10
innodb vs myisam
Hi, I have been using myisam tables in mysql with rails because my client will soon want fulltext searchable content, however when I migrated my development db from schema.rb all of the tables generated were innodb. I understand that I can override this, but also like the transactions and foreign keys of innodb. So 2 questions really: 1. are transactions in activerecord dependent on innodb or do
2006 Apr 25
3
limiting options in file_upload
Does anyone know if it''s possible to set constraints to the size & type of file that file_column will accept? I''d like to limit to image files of less than 2MB. If this isn''t possible with file_column, is there a graceful way of getting the controller to handle it? thanks dorian -- -- I do things for love or money
2006 May 09
2
handling file upload onto local filesystem.
Hi, I have a multipart form upload field uploaded through <%= file_field("profile", "profile") %> Once a submit happens, the action basically does something like: profile = Profile.new(params["picture"]) This invokes the models = to method: def picture=(picture_field) ...do a bunch of assignments here end def validate ... do a bunch of validations
2006 Mar 02
2
url_for_file_column not returning correct path
I added this test towards the end of the included file_column_helper_test.rb that shipped with the file_column plugin: def test_url_for_file_column_different_root_path Entry.file_column :image, :root_path => File.join(RAILS_ROOT, "public/files") e = Entry.new(:image => upload(f("skanthak.png"))) assert_match %r{/public/files/entry/image},
2006 May 16
4
dealing with media file formats and RMagick.
Hello, I basically have the following problem - I have a site that will allow people to upload videos. The video may be in any format - .mov, .avi, .wmv etc.. I can either use embedded Windows Media Player, or embedded Quicktime to play the files but the problem is, how do I create stills from the movies to display them as .jpg''s on my site so when somebody clicks on them, the video
2006 Mar 20
3
login_engine
Hello, I''m having trouble getting login_engine to work properly. I get the standard login/registration views, but whenever I try to register I get: NoMethodError in User#signup undefined method `password_confirmation='' for #<User:0x408b2f9c> I have login_engine, and engines installed from cvs: http://opensvn.csie.org/rails_engines/plugins/ anyone else had anything
2006 Mar 15
1
file_column imagemagick strangeness
Hi, I''m using the basic magick features of file_column, and while files are uploading fine without the magick options, as soon as I do something like :magick => { :size => "400x600" } I get an ''invalid file'' error. Further investigation reveals that the file is in fact invalid because something somewhere is truncating the file path:
2006 Jan 23
11
mysql dates
does anyone know of a way to make the date_helper deal with mysql dates with 00 values in them? I have lots of dates that are like the following: 2005-04-00 2005-00-00 and I need to set null values in a date_select for elements that are 00. These are valid dates in mysql. In the absence of an immediate solution to the above, I''ve been trying to find out how InstanceTag.new works so I can
2006 Jun 02
6
overriding constants
Hi there, I''m trying to override the defaults for form_helper. I can see in action_view/helpers/form_helper.rb: class InstanceTag #:nodoc: include Helpers::TagHelper attr_reader :method_name, :object_name DEFAULT_FIELD_OPTIONS = { "size" => 30 }.freeze unless const_defined?(:DEFAULT_FIELD_OPTIONS) DEFAULT_RADIO_OPTIONS = { }.freeze
2006 Mar 23
1
mod_fcgid
Hello, I''m using rails on apache2 with mod_fcgid and I can''t seem to set the RAILS_ENV properly. I have dev & production vhosts and would like to set the environment from within apache rather than globally via fcgid.conf, and I thought this might work from within the relevant vhost: DefaultInitEnv RAILS_ENV production but it seems to do nothing... Does anyone know the