Ruby on Rails »
tutorials for virtual railsTue, 27 Jul 2010 00:48:24 UT
I just finished installing virtual box and virtual rails on my laptop running vista os. this is all I know other then a bit of ruby code. im just starting out and learning ROR on my own. Does anyone have recommendations for tutorials on virtual rails?
Capistrano - override default, get/copy source from local
Tue, 27 Jul 2010 02:50:47 UT
I am working on getting Capistrano running for an app but need to ask it to download source to a local directory and then send it to the deployment server via scp/etc (there are reasons for this I won't get into). Below is where I am and what I am trying --- if anyone has done this or can show me where I am going wrong I'd appreciate it.
Sorting with related tables
Tue, 27 Jul 2010 07:59:38 UT
Hi I have two tables: users and tickets. A user has many tickets which is defined in the model. I want to order the users based on the number of tickets they have. What is the easiest way to do it in Rails without writing to many SQL statements.
Rails 3.0.0.rc1 update - issue w Bundler 1.0.0.rc.1 and ruby 1.9.2.rc1
Tue, 27 Jul 2010 09:11:56 UT
I upgraded my rails 3 version (now using bundler-1.0.0.rc.1 but bundle install in my test_app raises an error : bundle install Fetching source index for [link] Using rake (0.8.7) ... Using railties (3.0.0.rc) Using rails (3.0.0.rc) Updating .gem files in vendor/cache /Users/yves/.rvm/rubies/ruby-1 .9.2-rc2/lib/ruby/1.9.1/rubyge ms/package/
upgrading from rails2.3.5 to rails2.3.8
Tue, 27 Jul 2010 09:58:47 UT
Hi Please guide me to upgrade my rails application which is 2.3.5 version to 2.3.8 step by step. Thanks for your help Tom
New alternatives for rails/init.rb in Rails 3 gems
Tue, 27 Jul 2010 10:09:52 UT
In Rails 3 the rails/init.rb in gems is not automatically executed anymore (see [link]). As I see there a now two options: 1. Put scripts in config/initializers. 2. Create a lib/my_gem_name.rb The second alternative seems to be used for example by devise (http://
How to write codes for TDD
Tue, 27 Jul 2010 10:59:51 UT
Hi all, I am a newbie in rails. I have done some small applications in rails but can't know how to make TDD and BDD in RSpec and other tools. I have tried by reading the rpesc tutorial from rspec.info website, But can't understand where to start coding and run for Red, Green behaviour of code. Please help,
Rack in Rails
Tue, 27 Jul 2010 12:04:43 UT
Does Rack come with Rails or do I need to install the gem?
question regarding shorthand syntax for collection rendering
Tue, 27 Jul 2010 12:11:18 UT
Hi all, I have a collection which I render via <%= render :partial => 'comment', :collection => @results %> This works exactly as I expect it to. However, when I change it to <%= render :partial => @results %> or <%= render @results %> both of which the documentation describe as 'short hand' versions of
in production environment Rails 2.3 always ask for helpers
Tue, 27 Jul 2010 14:13:22 UT
Hi all, When I deploy my rails apps in production, it will barf out an error message if my controller does not have any helper. But this does not happen in development environment. Is there something that I can configure through rails so production does not ask for helpers for every controller? Thank you very much in advance for your help.
problems with rails3.0.0.rc and haml?
Tue, 27 Jul 2010 15:48:07 UT
Hi there, I have a Rails application I developed using Rails 3.0.0.beta4. Up until now no views were needed. My controllers just rendered text and status (webservice). Now i needed my first UI, i upgraded to rails 3.0.0.rc and i am for the first time working with haml. When i go to my first view, i get this very weird error:
Using an ActiveRecord model in routes.rb
Tue, 27 Jul 2010 17:36:06 UT
Is it potentially dangerous to use an ActiveRecord model in routes.rb? Here's a line from our routes.rb file: Registration#to_param returns the User's username. User::USERNAME_REGEXP is just a regex that matches one or more valid username characters. This route works as expected, but my concern is that using an
Test - Skip Setup
Tue, 27 Jul 2010 18:59:55 UT
Hi, I want to write a functional test using the default test unit that is included with rails 3. Is there a way to skip a setup call? So I'm trying to test the users controller. But to access those actions, I need to be logged in. So I put a login algorithm in my setup. But I do not need to be logged in to create a new user. This is why I
trouble with remote_form_for & html_update
Tue, 27 Jul 2010 19:56:27 UT
I have a form that accepts comments and adds them to a list without refreshing the page. This is the html: <div id='aremark'> <%= render :partial => 'comment' %> </div> <% remote_form_for :comment, :url=>story_comments_path(@sto ry), :html => { :id => 'comment' } do |form| %> <h5><label for="login">Make a comment:</label></h5>
Can't upload images - probably cause my routes are messed up
Tue, 27 Jul 2010 19:57:08 UT
I am attempting to create a model called "encyclopaedia" with multiple sections of encyclopaedia articles, each section having an image. When I attempt to upload an image, I get the error: Unknown action No action responded to upload. Actions: create, destroy, edit, get_encyclopaedia, index, is_admin?, is_owner_of, new, show, and update
need help installing Rails 3 on non-Intel Mac
Sun, 25 Jul 2010 21:13:41 UT
I'm having trouble installing Rails 3 (on a Mac Powerbook G4 running OSX 10.5.8). Specifically, when I try "gem install rails --pre" it says: ERROR: Error installing rails: activesupport requires Ruby version >= 1.8.7. But, if I do "ruby --version", it says "ruby 1.8.7 (2010-06-23 patchlevel 299) [powerpc-darwin9]".
form_tag question
Sun, 25 Jul 2010 22:01:54 UT
Hi, I am somewhat new to rails, and I have a question about form_tag: I have the following : <%form_tag "some_action" do%> ... and I have a route for "posts/:id/some_action" When I run this, I notice that (what seems miraculously), the app fills in the id while calling this route like: posts/12/some_action
Testing problems: ActiveSupport
Sun, 25 Jul 2010 23:31:12 UT
Hey everybody, I am trying to test a small application with a simple testing, but I get the following errors while using Aptana 2.0.5 with Ruby 1.9.1 and Rails 2.3.8(I know why I get the first one, but I'm not sure about the ActiveSupport errors): Exception: undefined method `screen_name' for nil:NilClass
zipcode validation doesn't work
Mon, 26 Jul 2010 00:17:09 UT
I am trying to do a very basic zipcode validation(zip is a int field in mysql). validates_presence_of :zip, :message => "Can't be blank" validates_format_of :zip, :with => /^[0-9]{5}(-[0-9]{4})?$/, :message => "Invalid Zipcode" No matter whatever valid 5 digit zip I enter, this does not work, but
[POST] - RoR jobs with HowAboutWe.com
Sun, 25 Jul 2010 23:48:09 UT
HowAboutWe.com is a rapidly growing NYC-based dating site - with a very new twist. People propose the actual dates they want to go on. Check us out in the NYTimes: [link] We're a small, agile, fun, ambitious team. We're building our



