#ruby on rails
15 posts tagged ruby on rails. Clear filter
-
Installing Ruby on Rails 3, MySQL, Git, Ruby Enterprise Edition, Passenger (Mod_Rails) on Ubuntu with Rackspace Cloud.
Short and sweet. Here all the commands I run in this order to set up a brand new box. It usually takes about 10 - 15 minutes on a 256 MB RAM instance. Compiling Ruby Enterprise Edition, which is...
-
Rails 3 disable_with Does Not Work with Ajax Remote Form_for
It appears that the :disable\with option on the submit\tag form helper method does not behave as expected with remote forms. I'm not sure if this is a bug or not. But the fix is pretty straight...
-
Execute Javascript When Using Link_to_function To Include a Partial in Rails
If you use the link\to\function to replace content in a div with content from a partial, any javascript that you include in the partial will not be executed. It is instead included, but will do...
-
Rails Select Tag and Onchange Event Calling a Remote Function with Default Option Selected
Here is a little code snippet that will fire off a request to update\client\path when you change the select field. This stands alone, rather than being apart of a larger form. The Client::CATEGORY...
-
Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems >= 1.3.2. Please install RubyGems...
After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time You then scratch your head and run to find that...
-
Renaming Routes in Rails 3 with :As and :Controller
Renaming routes in Rails 2.\ is straight forward. It goes something like this. This will give you users\path and form\for(User.new) helpers, for instance, mapping the url to /members instead of...
-
Using to_sentence method on an Array in Ruby on Rails
Declare separator and the connector
-
Collection Select Helper and OnChange Event in Rails
Given a collection of Active Record objects, you may use the collection\select helper method to produce a select form field. You need to pass in a number of arguments to the helper function. 1)...
-
Select Distinct in Rails with Active Record
-
Simple Activity Stream Implementation in Rails
There are many ways to tackle the Facebook style activity stream feature for your app. The simplest approach, which you can tack on at almost any moment, is what I'll describe here. You don't have...
-
Scope Routes/URLs By Username (like Twitter) in Your Rails Application
There are a few things that need to be taken care of before you can get this to work. The first thing (although, any of the following steps can be done in any order) to take care of involves your...
-
Using Formtastic to Cleanly Create Nice Looking Forms in Rails
Forms can easily get cluttered when you're dealing with a lot of form fields... er, ERB tags. I've written about extending Rails form builders, which certainly goes along way to shrinking your...
-
TODO and Custom Annotations in Rails Applications
While writing software it's common to leave comments for your future self. For instance, if you have written some code but realize that it should be refactored to be more efficient, you may place...
-
Load All ActiveRecord::Base Model Classes in Rails Application
Here is a simple rake task which will instantiate all of your Active Record models, provided that they are located in the RAILS\ROOT/app/models directory. Interestingly, all plugin models are...
-
Render Partial if File Exists
If you ever want to render a partial but don't want an error thrown you can either check for the existence of the file first or you can catch the error that Rails throws