Questions tagged [ruby-on-rails-3.2]

Ruby on Rails version 3.2.0 released at January 20, 2012. Use this tag for issues related to development in Ruby on Rails version 3.2.0.

Ruby on Rails version 3.2.0 is a specific version of Ruby on Rails. Released on January 20th, 2012. It has been succeeded by version 3.2.15. It brings many improvements to the Ruby on Rails web development framework.

The distinct features include:

  • Faster development mode: only modified classes are reloaded giving a visible performance boost.
  • Automatic Query Explanation: database queries taking longer than 30 seconds to execute are automatically explained while in development mode.

Further reading:

Related tag

6982 questions
235
votes
5 answers

Use rvmrc or ruby-version file to set a project gemset with RVM?

I use RVM, the Ruby Version Manager to specify a Ruby version and a set of gems for each of my Rails projects. I have a .rvmrc file to automatically select a Ruby version and gemset whenever I cd into a project directory. After installing RVM…
Daniel Kehoe
  • 10,952
  • 6
  • 63
  • 82
170
votes
20 answers

Server is already running in Rails

When I am starting rails server using rails s command it is showing A server is already running. Check C:/Sites/folder/Pids/Server.pids When I open the file it is outputting a 4 digit number only so how could I resolve this issue ? FYI No other…
swapnesh
  • 26,318
  • 22
  • 94
  • 126
126
votes
3 answers

Rendering JSON in controller

I was reading a book and in a chapter about Controllers when it talks about rendering stuff, for JSON it has an example like this but doesn't go in to details so I couldn't figure out the bigger picture that this example fits in: render :json =>…
user1899082
117
votes
3 answers

Rails: Custom text for rails form_for label

I want to display a label in form_for:
<%= f.label :name %>
<%= f.text_field :name %>
This generates the label "Name", but I want it to be "Your Name". How can I change it?
Paul S.
  • 4,362
  • 10
  • 35
  • 52
111
votes
7 answers

No secret option provided to Rack::Session::Cookie warning?

I am running Rails 3.2.3, Ruby 1.9 under Fedora 17. I get this warning, when I run rails s, and how do I fix? SECURITY WARNING: No secret option provided to Rack::Session::Cookie. This poses a security threat. It is strongly recommended that…
bigdaveyl
  • 1,391
  • 2
  • 9
  • 17
105
votes
6 answers

Using Rails link_to for links that post

I have a link that I need to submit a post request with. Normally, I'd use jQuery and prevent the link's default behavior and then submit a form to the destination. This seems like something Rails should be able to help me out with. Sure enough, the…
at.
  • 50,922
  • 104
  • 292
  • 461
81
votes
6 answers

Where to put Ruby helper methods for Rails controllers?

I have some Ruby methods certain (or all) controllers need. I tried putting them in /app/helpers/application_helper.rb. I've used that for methods to be used in views. But controllers don't see those methods. Is there another place I should put them…
at.
  • 50,922
  • 104
  • 292
  • 461
80
votes
3 answers

Adding a custom seed file

I want to populate a new feature with dummy data, but don't want to use the db/seeds.rb file as it already has seeds other data irrelevant for this feature. To run the default seeds.rb file, you run the command rake db:seed. If I create a file in…
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232
78
votes
4 answers

Weird issue with devise valid_password?

For the past 2 hours, I have been trying to debug a weird issue in devise which is not letting me login. Here's the stuff I'm referring too: password => 'vinodsobale' password == 'vinodsobale' => true resource.valid_password?(password) =>…
Viren
  • 5,812
  • 6
  • 45
  • 98
76
votes
12 answers

How to add confirm message with link_to Ruby on rails

I wanted to add confirmation message on link_to function with Ruby. = link_to 'Reset message', :action=>'reset' ,:confirm=>'Are you sure?' Any ideas why it's not working?
72
votes
6 answers

How to display a Rails flash notice upon redirect?

I have the following code in a Rails controller: flash.now[:notice] = 'Successfully checked in' redirect_to check_in_path Then in the /check_in view:

<%= notice %>

However, the notice does not show up. Works perfect if I don't…
at.
  • 50,922
  • 104
  • 292
  • 461
71
votes
2 answers

Rails emits warning: "Rack::File headers parameter replaces cache_control after Rack 1.5"

I've recently upgraded my Rails to v3.2. The server starts and works, however I'm noticing the following warning: Rack::File headers parameter replaces cache_control after Rack 1.5. In my development.rb I have the following configuration for cache…
alexs333
  • 12,143
  • 11
  • 51
  • 89
68
votes
2 answers

Difference between Render and Render Partial and Yield

I have read it from the Rails guides, Have looked at Micheal Hartel book and now reading it from Rails View book but still I get confused :( There is a _footer.html.erb file so it is a "partial" and in the code it has written: <%=render…
user1899082
67
votes
1 answer

How can i remove a column from table using rails console

It is easily possible to remove a column using rails migration. class SomeClass < ActiveRecord::Migration def self.up remove_column :table_name, :column_name end end I want to know if there is any way to remove a column from table using…
64
votes
4 answers

Reserved names with ActiveRecord models

I take naming pretty seriously, so I think pretty hard about good names for my ActiveRecord models. However, I frequently come up with a name and it has some conflict with a reserved name, either in the database or Ruby or Rails. Model or field…
1
2 3
99 100