Questions tagged [ruby-on-rails-3.1]

Ruby on Rails version 3.1.0 is a specific version of Ruby on Rails. It was released on August 30th, 2011. Use this tag for issues related to development in Ruby on Rails version 3.1.

Ruby on Rails version 3.1.0 is a specific version of Ruby on Rails.

Released on August 30th, 2011, it was succeeded by version 3.2.0.

It brings many improvements to the Ruby on Rails web development framework, which is open-source and optimized for programmer happiness and maintaining sustainable productivity. Many things are defined by convention, freeing you from having to re-invent things to stay productive.

Version 3.1 brings many improvements over its preceding version 2, including faster ActiveRecord, assets re-structure, coffeescript, sass, and more.

Further Reading:

Related tag

5270 questions
2
votes
0 answers

ActiveRecord::AssociationTypeMismatch error in nested form

When i submit the form i get an error ActiveRecord::AssociationTypeMismatch in ClassGroupsController#create User(#114808470) expected, got Array(#81535960) What seems to be the problem here? I am using rails 3.1. Here is my code. Thank you in…
2
votes
1 answer

Testing nested resource controller with rspec in Rails 3.1

I am trying to make a test for a controller for a nested resource. The nesting is like this in the routes.rb resources :cars, :only => [:index, :destroy, :show] do resources :car_subscriptions, :only => [:new, :create], :as =>…
Cristian
  • 5,877
  • 6
  • 46
  • 55
2
votes
2 answers

ruby on rails 3.1 global exception handler

I'm developing an app with Rails 3.1.2 but I can't find some documentation that works with errors / exception (like 404) on this version of rails. i have tried things like: In application controller rescue_from…
2
votes
2 answers

Union of two scopes results in NoMethodError (undefined method `default_scoped?' ...)

I have defined the following two scopes and both working fine: scope :regular_friends, lambda { |user| joins{friendships}.where{friendships.user_id.not_in(user)}} scope :inverse_friends, lambda { |user|…
Scholle
  • 1,521
  • 2
  • 23
  • 44
2
votes
1 answer

Routing error with devise {:controller=>"devise/static", :action=>"about"}

I got a problem with devise. Every time I try to call an Url that should be handled by devise (e.g. http://localhost:3000/users/sign_up) I end up with the following error: No route matches {:controller=>"devise/static", :action=>"about"} Hopefully…
Mark
  • 7,507
  • 12
  • 52
  • 88
2
votes
0 answers

Infinite Scrolling Sunspot With Kaminari Gem and Rails 3.1

I am trying run this infinite scroll but for me not working fine. https://github.com/amatsuda/kaminari/wiki/How-To:-Create-Infinite-Scrolling-with-jQuery I am using sunspot with kaminari gem that paginate fine the results. But when I trying create…
hyperrjas
  • 10,666
  • 25
  • 99
  • 198
2
votes
2 answers

Getting best_in_place gem to co-operate with Redcarpet markdown

For my markdown text i normally do the following on the text content(@user.content): <%= raw Redcarpet.new(@user.content).to_html.html_safe %> However i am now using the best_in_place gem like this <%= best_in_place(@question, :statement, :path =>…
Hishalv
  • 3,052
  • 3
  • 29
  • 52
2
votes
1 answer

Rails 3.1 Subdomain-specific Assets

I have a setup where I have an engine (non-namespaced) for each subdomain. This works great because each subdomain is able to specify their own custom routes, controllers, views, and models. But I haven't been able to figure out how to get assets…
alexlod
  • 1,363
  • 2
  • 10
  • 18
2
votes
1 answer

In Rails 3.1 how do I show only future events?

So I am building a calendaring application, and showing an event from the past is not as important as showing the upcoming events. Right now I have built the model for events to show the earliest events first, but how would I hide from view any…
keade
  • 137
  • 1
  • 11
2
votes
2 answers

rake assets:precompile not working (Rails 3.1.3 edition)

After review, this question has been asked many, many, many times. Yet I still don't grok why rake assets:precompile fails. I can view the following results from my browser using local server (e.g. thin): body{ @include…
rhodee
  • 1,257
  • 1
  • 14
  • 27
2
votes
1 answer

Not able to run bundle install or for that matter rails -v Rails 3.1.2

I was having issues with RVM so I tried to uninstall everything (Ruby, RVM and Rails) and start fresh. I installed Ruby 1.9.2 and Rails 3.1.2 rc2 and I am working on Ubuntu 10.0.4. If I do ruby -v from the command prompt I am able to see the ruby…
Dev R
  • 1,892
  • 1
  • 25
  • 38
2
votes
1 answer

Simple WYSIWYG Editor

Im searching for a real simple WYSIWYG Editor to embed it in a RoR Application. The trouble is that it should be used by 0815 users that dont want to learn a markup language. I know most WYSIWYG editors prduce bad HTML but there is no alternative…
davidb
  • 8,884
  • 4
  • 36
  • 72
2
votes
4 answers

Devise remove a user but keep his data, and set a flag _is_deleted in rails 3.1

I would like to delete a user with devise but be able to save its data just setting a flag like is_deleted to true and prevent login for those users. What would be the best way to do this in devise ? I have seen some write-ups on this but they were…
Rubytastic
  • 15,001
  • 18
  • 87
  • 175
2
votes
2 answers

Rails 3.1 How To Use Parent Attribute When Saving A Child?

Working on a Rails 3.1 project using Devise. My User model has_many :courses and a Course belongs_to :user. The User has a boolean attribute miles that the Course model needs to check before saving. I'm trying to use the before_save callback in the…
jacoulter
  • 730
  • 1
  • 9
  • 19
2
votes
2 answers

Rails Routing Error for nested form_for

I now this has been asked a thousand times but that doesn't help me heh :) I've been at this an hour. My form: = form_for @comment, :url_for => { :action => "create", :controller => "comments"}, :method => :post my rake routes: …
Inc1982
  • 1,955
  • 1
  • 18
  • 32
1 2 3
99
100