When is it acceptable to raise an ActiveRecord::IrreversibleMigration exception in the self.down method of a migration? When should you take the effort to actually implement the reverse of the migration?
...
What's the correct way of making checkboxes that are related to a certain question in Ruby on Rails? At the moment I have:
<div class="form_row">
<label for="features[]">Features:</label>
<br><%= check_box_tag 'features[]', 'scenarios' %> Scenarios
<br><%= check_box_tag 'features[]', 'role_profiles' %> Role profiles
<br>...
Hi,
I am having checkboxes in my html and pagination has also been implemented.
when i select few of the check boxes in first page and go to the next page through pagination,It unselects the previous page's check box.
and when i click submit it gives me values of the current page's selected check boxes only.
How to retrieve all the selec...
Hi Stack Overflowers: I'm building a Ruby on Rails application that has several different models (e.g. Movie, Song, Photo) that I am storing movie clips, mp3s and photos. I'd like for users to be able to comment on any of those Models and have control over which comments are published.
Is the best practice to create a Comment model with...
I'd like to translate the OpenIdAuthentication plugin into another language but I'd like not to change the plugin directly.
Here's the basic structure of the messages I want to translate:
module OpenIdAuthentication
class Result
ERROR_MESSAGES = {
:missing => "Sorry, the OpenID server couldn't be found",
:invali...
Hello
My issue involves an array that is apparently not nil but when I try to access it, it is.
The array is returned from a find on an active record. I have confirmed it is in fact an array with the .class method
@show_times = Showing.find_showtimes(params[:id])
@show_times.inspect =>shows that the array is not empty and is a multidi...
I have a state field that stores the value as 2 characters. For example, Alabama is saved as AL, Alaska is saved as AK, Arizona is saved as AZ, etc. In the show.html.erb, how do I display the long name for the state such as Alabama instead of just showing AL? Is this possible or should I just store the long name in the database such as A...
I am wondering what other people have experienced in creating a web service application, what language/framework is best suited for a beginner? Are there characteristics of the chosen language that make it better suited to programmers of a certain way of thinking that makes language XYZ appeal to particular programmers more?
I'm looking...
In reference to this
I've created a question in a webform like this:
<div class="form_row">
<label for="features[]">Features:</label>
<% [ 'scenarios', 'role_profiles', 'private_messages', 'polls' ].each do |feature| %>
<br><%= check_box_tag 'features[]', feature,
(params[:features] || {}).in...
Similar to this question: http://stackoverflow.com/questions/621340/checkboxes-on-rails
What's the correct way of making radio buttons that are related to a certain question in Ruby on Rails? At the moment I have:
<div class="form_row">
<label for="theme">Theme:</label>
<br><%= radio_button_tag 'theme', 'plain', true %> Plain
...
I'm having ruby instances from mod_rails go "rogue" -- these processes are no longer listed in passenger-status and utilize 100% cpu.
Other than installing god/monit to kill the instance, can anyone give me some advice on how to prevent this? I haven't been able to find anything in the logs that helps.
...
In my Rails app, I have a login page. After that person logs in, what is the best way for my app to continue tracking the person that has logged in. For example, if the user moves to different pages, my controllers/actions will lose track of that user unless I keep passing a variable between each page the user subsequently visits. Is the...
Here a code I'm using now.
<%= f.select :project_id, @project_select %>
How to modify it to make it it's default value params[:pid] when page is loaded?
...
Does anybody know a place with a bunch of Ruby On Rails Layouts/CSS combinations? I am starting new applications and would like to give them different look, but I am not a designer, so I would love to use someone's else free layouts/css for starters.
...
I am trying to create a model for a ruby on rails project that builds relationships between different words. Think of it as a dictionary where the "Links" between two words shows that they can be used synonymously. My DB looks something like this:
Words
----
id
Links
-----
id
word1_id
word2_id
How do I create a relationship between t...
I'd like to add something like the "remember me" option into a Rails application and I need to create a persistent session that doesn't expire when the user closes his browser.
The only solution I found right now is to use a plugin:
http://blog.codahale.com/2006/04/08/dynamic-session-expiration-times-with-rails/
Are there any other (bet...
I'm working in Rails and I'm looking for a library/gem/plugin to generate a graphic from text. Google Maps doesn't allow you to overlay text, only graphics so I'm looking for a back door to overlay text. Suggestions?
...
Following the great advice of Chris Wanstrath, I decided to vendor everything.
However, whenever I run a rake task now I get an error for each of my unpacked gems stating
config.gem: Unpacked gem gemname in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
I've done this but no dice. Anyone have the...
How do you handle real name conflicts? Is there an established best practice or UI design pattern for disambiguating records like this? If authors can have many articles but more than one author can possibly have the same name how would you enable users to select the author they actually want when creating articles?
I can't dictate th...
I'm using my Gmail Apps for Domain account to send email within my rails application for standard automated emails (user signup, forgot password, notify admin of new comment, etc), but I'm worried about the 500 emails per day limit set by Google.
Google suggests one way to overcome the limit is to use multiple user accounts.
So, I'...