similar to: Active Record Query

Displaying 20 results from an estimated 10000 matches similar to: "Active Record Query"

2006 Dec 06
2
validates_uniqueness_of where scope euqals created_by "magic" field
I have the following ActiveRecord objects: class Recipe < ActiveRecord::Base has_many :ratings, :dependent => true . . . end class Rating < ActiveRecord::Base validates_uniqueness_of :created_by, :scope => :recipe_id belongs_to :recipe, :counter_cache => true . . . end The created_by field on Rating is implemented as a "magic" field similar to this:
2006 Jan 19
5
limits of has_and_belongs_to_many
I''m experimenting with Rails on the Recipes example first before I dive into applying it to my intended application. I''m exploring which will be more work: to rename all the primary id''s in the legacy database, or to work around the fact that the primary id''s are not called ''id'' within RoR instead. I''ve been successful in using a
2006 May 07
6
RuntimeError in Recipe#edit
I have tried to learn ruby on rails from scratch by going into a tutorial at the following website. http://instantrails.rubyforge.org/tutorial/index.html I followed the suggestions and encountered 3 problems so far. 1. Couldn''t start the Apache server. Error message "Port 80 was used by some other process." I over-came the problem by going into configuration and change the
2008 Apr 10
7
Trouble installing ruby-debug
I have installed ruby-debug several times without any problems, but am running into one when rebuilding my system. I am typing in the following command to install it as root: gem install ruby-debug -y I keep getting the following response: INFO: `gem install -y` is now default and will be removed INFO: use --ignore-dependencies to install only the gems you list ERROR: While executing gem
2008 Jul 01
8
InstantRails
Does anyone know if InstantRails will be upgraded for Rails 2.1? I see a lot of threads where people are discussing problems upgrading from 2.0 to 2.1. I would rather wait for InstantRails2.1 if it was close? Thanks. Bharat -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2012 Apr 02
0
active admin saving selection from collection_select and passing to controller
hi i am using active admin for my app i have a partial with a drop down list where the menu and recipe are populated this page is to group the recipe in a menu _menu_recipe.html.erb <%= semantic_form_for [:admin, @menu_recipe] do |f| %> <p> <%= f.collection_select :recipe_id, Recipe.all,:id,:name,:prompt => true%> </p> <p> <%= f.collection_select :menu_id,
2010 Aug 17
3
Rails 3 flash message problems
The following code in my application_helper.rb class either eats the flash message or escapes it and does not display properly: # Outputs the corresponding flash message if any are set def flash_messages messages = [] %w(notice warning error).each do |msg| messages << content_tag(:div, content_tag(:p, html_escape(flash[msg.to_sym])), :class => "message
2009 Mar 24
12
MonkeyPatching ActiveRecord::Base class
I am trying to monkey-patch the ActiveRecord::Base class to incorporate a generic search class method so that it can be used by all model classes which need this functionality. Since model classes directly inherit from ActiveRecord::Base and unlike controllers and helpers, do not have an ancestor class defined, I think I am forced to open the ActiveRecord::Base class and patch it? May be I am
2007 Mar 09
3
NetBeans 6.0/Script Console Window
Has anyone figured out how to turn NetBeans IRB window into Ruby on Rails script/console window where the gems like ActiveRecord, ActionPack etc are recognized? May be an easy one for the Rails Guru''s out there, not for me. By default, the NetBeans IRB window only loads Ruby. I am trying to see how well NetBeans 6.0''s Ruby/RoR support works fully realizing that it is an alpha
2008 Jan 21
4
Rails app cannot connect to Ferret server
I have installet the Ferret gem v. 0.11.6 and the latest acts_as_ferret plugin from svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret I''ve followed the instructions here http://projects.jkraemer.net/acts_as_ferret/wiki/DrbServer to set up the server, and put acts_as_ferret :remote => true on one of my models (Ad) I can also start the ferret_server, but when
2008 Jan 20
9
Ferret Gem Installation on Windows
Trying to install ferret on my windows XP environment. Using InstantRails 2.0 with RoR 2.0.2, and NetBeans 6.0. I had successfully installed and built RailsSpace in InstantRails 1.7, but am trying to upgrade RailsSpace to RoR 2.0.2 using the code that Michael has kindly provided for us on the website. When I run the gem install ferret command, I get the following error: C:\Documents and
2010 Nov 08
7
Webrick Failing with Illegal Instruction
I''ve just started a new rails project (3.0.1, ruby 1.9.2 on Mac OS X), and have a few parts of it built out. I''ve just created new controller/views using rails g scaffold_controller Lesson, and then added a route to routes.rb with "resources :lessons" Now, when i go to /lessons, Webrick fails with "Illegal instruction" The controller function getting hit is
2008 Oct 07
4
Moving from one dns domain to another
My Rails 2.1 app is changing DNS domains. For example: From: www.oldcompany.com To: www.newcompany.com The app uses Apache2, mongrel_cluster, MySQL. I would like the existing users who visit www.oldcompany.com URLs to be: 1. Notified via an HTML page that the site has changed from oldcompany to new company and then redirect them to newcompany. This has to be done on the same server which gets
2008 Jul 24
0
Getting Foreign Key to work!
Okay. So I have this simple site, which includes Recipes and then Comments. I want ppl to be able to comment on the recipes, and so I made comments have a recipe_id as it''s foreign key etc. I''m not that much of a noob to not know that stuff. When I click on a recipe, and then make a new comment and click ''submit'' (for the comment) it submits it, but it still
2010 Jun 24
1
Rails 2.3.2 upgrade to 2.3.8 problem
Upgrading to Rails 2.3.8 from 2.3.2 has broken views in my application. Specifically the field labels are all displaying </br> after the label text and therefore the alignment is all messed up. Instead of nicely aligning with the label text on the top and text entry field under it, they line up side-by-side and are misaligned. The tell-tale sign is the appearance of </br> tag after
2006 Mar 07
1
Error when trying Rolling with Ruby On Rails
Hi everyone! Please excuse my ignorance! I was working through the Rolling with Ruby tutorial to get a feel of things. Everything seems to work until I tried editing as in the last example in part 2 when I got the following error - |Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id ||| Extracted source (around line *#8*): |5: <body> 6:
2006 May 09
6
Still Stumbled on First things in trying RubyOnRails
Still Stumbled on First things in trying RubyOnRails http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html http://instantrails.rubyforge.org/tutorial/index.html http://rails.homelinux.org/ I had tried the first of the top 12 tutorials and got stuck after adding a new field ?category_id?in the table recipes,
2006 May 20
3
In a find, can''t you use both :include and :limit ?
I''m trying to do a find that includes a join. It has to be a find because I''m using the results for a Pagination, so I need to limit my query to the number of results I want to display per page. Here''s the type of thing I want to do: Employee table <-> Skills_Employees table <-> Skills table Let''s say I want to find all the employees who have
2017 Mar 20
1
Icecast Digest, Vol 153, Issue 3
Can you please unsubscribe me from your emails. John Dohnt support at psrfm.org.au -----Original Message----- From: Icecast [mailto:icecast-bounces at xiph.org] On Behalf Of icecast-request at xiph.org Sent: Monday, 20 March 2017 10:42 AM To: icecast at xiph.org Subject: Icecast Digest, Vol 153, Issue 3 Send Icecast mailing list submissions to icecast at xiph.org To subscribe or unsubscribe
2018 Jul 19
3
Which is better? Microsoft Exchange 2016 or Linux-based SMTP Servers?
On 19/07/2018 15:57, Valeri Galtsev wrote: > <rant> > As far as google anything goes, not everybody volunteers one's > information into paws of google (and quite likely one or more of 3 > letter agencies collecting information that way). I know (call it > educated guess) that about 70% of messages I send are ending up in > google databases whether I want it or not.