similar to: Hash with key and value from ActiveRecord?

Displaying 20 results from an estimated 10000 matches similar to: "Hash with key and value from ActiveRecord?"

2009 Mar 28
10
Use fixtures within fixtures?
Heya, I''m using globalize2 and have following problem with my fixtures: categories.yml: one: parent_id: two color: #ff00aa two: color: #00ff11 three: parent_id: two color: #ab00ab category_translations.yml one-en: id: one locale: en name: Cars one-es: id: one locale: es name: Coches two-en: id: two locale: en name: Start two-es: id: two locale: es
2010 Aug 22
7
Rails 3: Error saving an object with no useful information
Hey, I''m kinda desperate cause I''m getting an error and have no idea how to fix this since it doesn''t give me any information hinting where the problem is: irb(main):054:0> reload!;User.last.save! Reloading... NameError: undefined local variable or method `to_ary'' for #<User:0x4ed5d20> from
2010 Sep 13
10
Could not find [GEM] locally or in a repository
Hey Guys, How could I fix the following: "gem install --no-rdoc --no-ri kete-feedzirra" ERROR: could not find gem kete-feedzirra locally or in a repository "gem install --no-rdoc --no-ri libxml-ruby" ERROR: could not find gem libxml-ruby locally or in a repository "gem install --no-rdoc --no-ri http_url_validation_improved" ERROR: could not find gem
2010 Jan 30
12
Best way to connect various applications?
Good evening, I''ve got three different self-programmed Rails application I need to connect and manage with a 4th "supervisor" application. There''s a wiki application, there''s a shop application and there''s a business directory application all with seperate user database etc. What I want now is one single user table so it can be all controlled by one
2011 Sep 07
6
FactoryGirl doesnt produce unique names?!
Hey, I got following very simple test case: require ''spec_helper'' describe Country do it "should create a new instance given valid attributes" do Factory(:country) end end Factory looks like: Factory.sequence :country_name do |n| "Country #{n}" end Factory.define :country do |c| c.name Factory.next(:country_name) c.nationality "Foo
2009 Jul 03
5
Can't install RMagick due to MagickWand problems
Hello, I''m trying to install/update rmagick on a Debian machine using: gem install --local rmagick-2.10.0.gem and get following error: /usr/local/bin/ruby extconf.rb install --local rmagick-2.10.0.gem checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... yes Warning: Found more than one ImageMagick installation. This could cause problems at
2009 Sep 04
12
Changing cursor while waiting for remote function response?
Hello, Google and the search function didn''t help me this time. Is it possible to change the mouse cursor while waiting for a response of a remote function call? -- Posted via http://www.ruby-forum.com/.
2010 Aug 22
1
rails3: t.index in migrations not working anymore
Hello, I''m playing around with Rails3 and trying to upgrade one of my applications to Rails 3.0.0.rc and I get an error which should be still working. Migration: t.index :name When I execute rake: rake aborted! An error has occurred, all later migrations canceled: undefined method `index'' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x4b2b6b0> Does some one
2010 Jul 13
1
will_paginate destroys link_to_remote?!
Hello, I''ve got a list in a view and each of element of it has a link_to_remote and everything worked like a charm. Now I added AJAX pagination and the link_to_remote doesn''t work anymore. This is the partial of the list: <% for character in characters %> <%= character.name %> <%= link_to_remote t(''.add''), :url =>
2011 Nov 01
1
Rails 3.1, stylesheet assets not being reloaded correctly?
Hi, I''m working on a Rails 3.1 project at the moment and having a hard time getting the stylesheets properly loaded. My application.css.scss looks like this: /* * This is a manifest file that''ll automatically include all the stylesheets available in this directory * and any sub-directories. You''re free to add application-wide styles to this file and they''ll
2010 Sep 12
11
Rails 3: finding a record by name in multilingual app
Hello, I upgraded my application from Rails 2 to Rails 3 and ran into a problem. In rails 2 I could use the english name of the record to find it like: Page.find_by_name("Welcome") even though the user chose German as the language (which of course showed the German welcome page. Eversince I switched to Rails 3 (default_locale still :en) I can''t find anything by giving the
2008 Nov 05
2
Warning: Ambiguous first argument; make sure.
Hello, I''m getting this warning: Warning: Ambiguous first argument; make sure. in my unit test: assert_match /^[a-zA-Z0-9]+$/, user.username Does anyone know why or how to change it so it disappears? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2010 Dec 02
7
Rails 3 + Authlogic not working all of a sudden
Hey People, I''ve been working on Rails 3.0.0 and Authlogic for quite a while now but all of a sudden I can''t login into my application anymore. After some research I found out that no sessions are stored into the db anymore so I started the console and saw this: ruby-1.9.2-p0 > u = UserSession.new({:username => ''Test'', :password =>
2008 Nov 13
5
Touch an ActiveRecord - timestamps
When I update an ActiveRecord, i would like to "touch" one of the related objects, that the updated record belongs_to, in order to update the timestamps on the parent record, although i don''t want to change any of the data in the parent. Whats the accepted way to do this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You
2009 Oct 07
1
Empty validation error messages?
Hello, I''m have a form and the error messages are not being displayed properly I got a remote_form_for and am trying to show errors like I always do: <%= error_messages_for @user%> but the output is: 4 errors prohibited this user from being saved There were problems with the following fields: * {{attribute}} {{message}} * {{attribute}} {{message}} * {{attribute}}
2009 Sep 04
3
How/where to load initial data?
Hello, I''ve got a got a question about how and where to load initial data that is necessary in order to make the website work (menu structure, page contents, ...) I know it''s preference and everybody can do it as s/he wants but I just wanna know if there''s any convention or something like that. First of all, how do I normally load necessary data as mentioned above?
2009 Mar 04
6
render yield?!
Hello, I''ve got a little problem with remote functions. I call it for example like this: <%= link_to_remote ''bla'', :url => ''bla/whatever'', :method => :get %> that function would be: def whatever flash[:notice] = "You''re in whatever!" update_content end since I don''t want the page to be reloaded completely,
2010 Aug 07
3
Test Database Empty after "rake test"?
Hey, can somebody tell me why my test database is always empty after I run "rake test" but not after I test single test files? My rake db:seed for the test database takes like 6 minutes and I don''t really wanna reseed it every time I run "rake test". Is it possible to not let "rake test" truncate my database? -- Posted via http://www.ruby-forum.com/. --
2010 Oct 10
3
protecting resources in an app
hi chaps. just want to check that i''m on the right lines with protecting resources in an app, the idea that only the resources owner can do stuff to it I figure there are only two steps I need (with authlogic), but I may be missing stuff 1st is a check authorised before filter, which just checks that a valid user is logged in that before filter is on all the actions that need protecting
2011 May 20
3
How to handle non model data in form?
Hey, I got a form which looks like this: - form_for(@article, :html => {:multipart => true}, :url => articles_path) do |f| = errors_for(@article) .field = f.label :text %br = f.text_field :text .field = f.label :author_id %br = f.text_field :author_id .actions = f.submit But since I don''t want anyone to type in an author id I changed it