Ruby on Rails »
about routesSat, 04 Sep 2010 14:11:33 UT
Hello everyone, I'm trying to map a controller actions with the name as a action. I've got it well: match "/home" => "main#home", :as => :home match "/contact" => "main#contact", :as => :contact match "/whoweare" => "main#whoweare", :as => :whoweare But I want to do this with only one line of code. I've tried it with
Moving ROR Dev from one windows PC to another
Sat, 04 Sep 2010 18:26:31 UT
Is it possible to move the complete ROR install/development directory or directories to new PC and continue to work/dev as the original one? Are there any registry entries that would preclude this working on the new PC? Thanks!
Decimal numbers pain
Sat, 04 Sep 2010 21:20:50 UT
Hi, What do you guys use to definitely handle decimal numbers? This is getting me crazy! I use BigDecimal, but it craps out of the input number is something like "14,53", Rails transforms it as 14.0 Any solution?
sqlite3/sqlite3_native (LoadError)
Sat, 04 Sep 2010 22:43:32 UT
Hi, I have installed ruby 1.9.2, rubygems 1.3.7 and rails 3.0. created a demo application. when I start 'rails server' I get: 'require': no such file to load -- sqlite3/sqlite3_native (LoadError) any idea ? Thank you. Dani
Rails friendly Forex broker?
Sun, 05 Sep 2010 00:13:08 UT
I'm starting a new hobby. Going to learn about and have a try at building some automated trading systems for forex and other markets. So far I've been very disappointed with the results of my googling looking for a broker and/or third-party product to use as a bridge between the software I will build and an actual trading account.
Developing a web chat using Rails 3
Sun, 05 Sep 2010 00:26:18 UT
Hi! I'm trying to develop a web chat (like the facebook one, but much simpler) that works inside Rails 3, and so I'm inquiring about the methods used for this scope. I had some success applying this guide [link] , so now I am able to send messages form the server to the client.
Formatting data before ActiveRecord insertion
Sat, 04 Sep 2010 23:31:04 UT
Hello, Sorry if this is a noob question. I'm trying to store a hash of values (a user's music collection) into a single database record without having to have a separate row in the db for each music track the user has in his collection. e.g. User 9 { 12319 => "Artist X: Song Name 1", 12198 => "Artist X: Song Name 2",
drop_receiving_element does not fire
Sun, 05 Sep 2010 04:23:52 UT
I am trying drag and drop in RoR for the first time. What I want to achieve, is a list of slots, and a list of entries. You should be able to drag an entry onto a slot and slot.entry_id will update to match the dragged entry.entry_id. I've spent a lot of time looking in textbooks and online, but cannot
Whats a good way to avoid nil lookup errors
Sun, 05 Sep 2010 10:55:48 UT
When navigating to: [link] Whats a good way of avoiding the error: "Couldn't find User with ID=12", which happens when i try to display a page of user_id 12 that doesnt exist in the database. Instead of showing the error. id like to show a page that says: "This user does not exist"
undefined method `path' for Gem:Module (NoMethodError)
Sun, 05 Sep 2010 12:01:04 UT
Hi, when running - 'ruby setup.rb' I get the following error message: C: ubygems-1.3.7>ruby setup.rb C:/rubygems-1.3.7/lib/rubygems /source_index.rb:68:in installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError) Ruby version is ruby-1.9.2-p0. Any idea ? Thanks. Dani
Installing rails on lucid lynx.
Sun, 05 Sep 2010 12:55:25 UT
I am getting the following error when I try to install rails on lucid lynx :- mark@mark-laptop:~/code/ruby$ sudo gem install rails ERROR: Error installing rails: i18n requires RubyGems version >= 1.3.6 I have installed RubyGems1.9.1, but it seems that "gem" is still at version 1.3.5 :- mark@mark-laptop:~/code/ruby$ /usr/bin/gem1.9.1 -v
Restful_authentication sending email on each login
Sun, 05 Sep 2010 13:09:38 UT
Hi All, I'm facing a strange problem. I've configured RA with default account activation email setting. All works fine but whenever user logs in, an email is sent saying your account is activated. This happens on each login. Can somebody help me out with this? I'm using ruby 1.8.7 and rails 2.3.8. TIA.
Rails and database connection pooling
Sun, 05 Sep 2010 13:57:18 UT
Hi all, I am interested to learn more about connection pooling in rails. Is there any good articles about this? I want to know specifically how is connection pooling in rails works. Does rails open one connection to the database for every user that is connected or does every user share the same database
How about the heroku
Sun, 05 Sep 2010 14:01:46 UT
Hi all, I am new to rails and I do not want to install rails on my own machine. Finally I found that there is cloudy rails server that called heroku. Could you kindly tell me does that application is good enough for developing rails? Is that free? Does it work well? Thank you. Eason
Default value depending on the controller action
Sun, 05 Sep 2010 15:08:13 UT
The solution that is good for me: <% if controller.action_name == 'new' %> <%= f.text_field :image_url, :value => 'no image' %> <% else %> <%= f.text_field :image_url %> <% end %> and then in index.erb set smth like that <%= product.image_url == 'no image' ? image_tag("/images/ empty.png", :alt => 'Book cover', :class => 'list_image') :
Jquery post authenticity_token is not sent
Sun, 05 Sep 2010 18:25:53 UT
I have installed jquery-ujs driver and include jquery script in my view. In my view I have the following function $(function () { $('#alert').click(function () { $.ajax({ type: "POST", data: ({ lat: this.getAttribute('data-lat'), lon: 22.3908355 }),
Rails 3 production with fastCGI
Sun, 05 Sep 2010 17:03:43 UT
Does someone know how to push project into live. Project is written on Rails 3 and uses ruby 1.9.2?
Action Controller Error: undefined local variable or method `current_user'
Fri, 03 Sep 2010 23:19:04 UT
Newbie learning Rails. I'm currently on Chp9 here: [link] At the end of the tutorial, rails is erroring (see below). being new to Rails and after having checked the tutorial... How do you resolve this kind of error. It's saying current_user is not defined, and it is
Triggering Javascript from a Ruby form
Sat, 04 Sep 2010 00:14:39 UT
Hello again, I've managed to hack together an uploader, but I need a progress bar to go with it. I ended up using FTP to upload, and got a way to find the progress while it's uploading. I split that off into another function in the controller, which is all well and good. The problem is that I need to repeatedly call the how_finished function
Using ActiveRecord Find with associations
Sat, 04 Sep 2010 00:27:31 UT
Here's an example: class LineItem < ActiveRecord::Base belongs_to :order end class Order < ActiveRecord::Base has_many :line_items end my_line_item = LineItem.find(:zipcode => "12345") Order.find_by_line_item(my_lin e_item) # doesn't work Order.find_by_line_item_id (my_line_item) # does work I was surprised by this, because it seems to force me to make reference



