Posts Tagged “ruby on rails”

To convert multiple <img> tags in a single HTML file such as
<img src =”hello.jpg” alt = “hello” />

to Ruby on Rails ERB helpers in your .html.erb file like this:
<%= image_tag(“hello.jpg”) %>
Read the rest of this entry »

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , ,

Comments No Comments »

What’s the difference between a scaffold and resource in Ruby on Rails? Essentially, the only difference is that the views (and associated layout and css file) for index, show, new and edit are created. The output when generating both the scaffold and the resource (with the command line generator) are shown below.

Read the rest of this entry »

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , ,

Comments No Comments »

A friend of mine was over tonight and we were troubleshooting a issue with SVN authentication via the Redmine project management software. Redmine is built with Ruby and on this server is running via Apache and Mongrel. I needed to set the project to run in development mode but wasn’t very familiar with the Mongrel setup. After some research I found it was easy to change the environment from production to development using the Mongrel Cluster .yml file for that project. When using Mongrel each site appears to get its own .yml file so you can modify whatever settings you want to on a per site basis. Below I describe what needs to be changed, default locations, and any other actions that need to be taken to restart the Ruby on Rails project in development mode.

Read the rest of this entry »

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , , , , , ,

Comments No Comments »

It is possible for data within a PostgreSQL database table to get out of sync. When this happens it is possible for an attempt to be made to write data to a row in a table that already exists. This is being kept track of internally within Postgres by an ID of some sort and you can reset what the next ID that will be written to a row will be. Typically this will resolve your issue.

I received the below error in a Ruby on Rails application that was attempting to write data to PostgreSQL and at some point the data got out of wack.

Read the rest of this entry »

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , , ,

Comments No Comments »

My favorite free Rails references (not tutorials):

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags:

Comments No Comments »