ruby-on-rails

Can Netbeans be used as an IDE for Sinatra?

Preface: I'm a big fan of Netbeans for Rails development. I'm just starting my first Sinatra app and it doesn't look like Netbeans provides any IDE support for Sinatra development. Has anyone discovered a solution or did I just miss something? ...

What version of Ruby should I use with Rails 2.3.3?

Can I use Rails 2.3.3 with Ruby's latest version (1.9.1)? On this page, they recommend Ruby 1.8.7. ...

version control rails and databases, where to start?

I'm from an clientside language programming background, specifically ActionScript. So although I'm fairly code aware I have very little server side experience, particularly version control of databases along with the rails application itself. And then there's the command line which is a complete mystery. Right now I'm building my first ...

rake aborted! closed stream after upgrading to Snow Leopard

Hi all, I just upgraded my Leopard system to Snow. I had a Rails application with a suite of Spec examples running before the upgrade; it used a mysql database. After the upgrade, running rake spec would fail like this: ... ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load rake aborted! closed strea...

Rails search form - directly to top result

Does anyone know how to make a search form (in rails) go directly to the first result, rather than a page of results? ...

using layouts for menus in rails

With ruby on rails, the scaffolding creates layouts for all the controllers. If I decide to use an application layout, then I need to delete all those layouts (otherwise they will override the application layout). Now, I'm assuming most sites are going to want some site wide menu. The most straightforward place to put a site-wide menu ...

Model nested under multiple models?

Hey guys, lets say I have the comments model, nested under the posts model. Now lets say I add a user model, and I want the user to be able to see their comments, in their profile. So I nest the comments model under the posts model as well? So far - this hasnt been working ...

Passing post data in a rails app through a redirect

Hi, this seems simple but I can't figure it out. I receive post data in my rails app through a form and I want to use a redirect (instead of a render) but keep at least one of the pieces of post data alive through the redirect. How can I do this? Adding a hash on to redirect_to doesn't seem to work. ...

when to ditch active record?

I'm not new to Rails but I've not done anything quite so complicated as this so far, so I'm curious what a more experienced rails developer might share: I have a sql query which joins 4 or so tables into one output: SELECT places.id, places.name, places.email, places.website, places.blurb, external_ratings.rating, photos.data_file_name...

How can I see what the request object looks like?

Whenever I try logger.info ("REQUEST: \n " + request.to_yaml) I get this error: can't dump anonymous class Class What's the best way to see what's in the request object (in a readable way)? ...

DRY out my CSS, but want to keep the basic CSS syntax.

Starting a new rails project and we have a well-thought-out color palette, and want to capture that in one place. I have usually kept colors in the CSS, but I find I end up with all the same color in lots of different selectors, as it shows up as a background color, color, border color, etc. I also will occassionally need access to color...

Adding content to a layout from a partial.

Suppose I have an application layout, and in their I yield for :head content as follows: <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <title></title> <%= stylesheet_link_tag 'scaffold' %> <%= yield(:head) %> </head> Suppose in that same application layout I call a partial to render the ma...

rails view without a controller

Can rails handle creating a view without a controller? For example, let say I have a page that just links to other pages, would I need to create a dummy controller for that, or could I just do something in my routes file? ...

Realtime with PubSubHubBub

Hi All I'm trying to implement real time chat engine with PubSubHubBub as the core in Rails. My question is what I need to do to or read to achieve this task ? Where I'm gonna start ? What knowledge do I need to know first because I'm really really newbie in this field and like to play with it... or are they any realtime chat engine tha...

Form submission with errors displays form + errors at a different URL from the original form

I'm working on a relatively simple website with (currently) a single resource. I have a form at GET /maps/new that submits data for a new Map to POST /maps, which redirects to GET /maps/:id after completion. The problem here is that if validation fails, it renders the new-map form, so the URL is still /maps. But redirecting to /maps/new ...

Continue education or put myself out there?

Hi, I've been programming as a hobby for a long time. I'm 23 years old and and haven't completed college. My job right now is not programming related (although it is in IT). I just started going back to college this year (a community college) and I'm finding it very difficult because the classes are extremely basic. I don't feel comfort...

FB:Request-Form Element Not Rendering

Trying on FB Connect on a Rails App w/ Facebooker, but the following element is not rendering for some reason. It appears in the HTML code, but nothing shows up in Firefox. Any leads on where to start? <fb:request-form action="create_poke_path" content=" If you select some friends, they will see this message. &lt;fb:req-choice lab...

Linking to assets without the asset helper.

Is there a way I can link to an asset in my public folder without having to use the AssetHelper? I have a .swf flash player that I am trying to embed in one of my views but I cannot tell the javascript to include it without a valid path. ...

AASM: Verifying which object is moving a state forward

I'm using AASM from http://elitists.textdriven.com/svn/plugins/acts%5Fas%5Fstate%5Fmachine/trunk In my example, I have a Karate dojo rails site. On the site, Teachers can manage the classes they instruct and move their students to the next logical belt. My "Student" model use AASM for belt progression and it's defined like this: cl...

Mysql gem for Snow Leopard Install

Hey guys, I'm trying to get the mysql gem installed with a fresh install of Snow Leopard. I got mysql 5.1 x86 installed from mysql site, and have tried install the mysql gem using this command. sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config getting no love. this is my error. gcc -I. -I/us...