rails 3.2 rails with backbone, can sprockets and requireJs works together? - ruby-on-rails-3

In the context of a rails 3.2 rails with backbone, can sprockets and requireJs works together? cannot figure it out myself or find on the web.

I think you want to use sprockets OR requirejs, but not both. There is a gem for easy use of requirejs in rails (https://github.com/jwhitley/requirejs-rails/).

Related

devise undefined method `users_url' for RegistrationsController

Rails 3.2.12 + Devise 2.2.3
A NoMethodError occurred in registrations#create:
undefined method users_url' for #<RegistrationsController:0x007fd04f04b330>
actionpack (3.2.12) lib/action_dispatch/routing/polymorphic_routes.rb:129:inpolymorphic_url'
the app works fine on rails 3.2.8
I had the same problem, it looks a problem inside Devise (still present in master).
The only solution I found was to go back to Devise 2.1.2 (I knew it was working because I used it in another project).
So to fix this problem you can put
gem 'devise', '2.1.2'
in your Gemfile and then re-install it with
rails generate devise:install
Hope it helps you while Devise's team fixes it

Rails application as a gem

Suppose I have a rails application. What should I do to create a gem from it and distribute it to heroku (for example)?

PDF prawnto are not working with rails 3.2.8

we are using prawn to generate pdf file in our rails 3 app. Now after upgrading to rails 3.2.8, there is a problem with rails plugin prawnto. Here is the errror:
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them o
ut and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes
for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at D:/rails_proj/
emclab-failed2/config/environment.rb:5)
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern inst
ead. (called from extend at D:/rails_proj/emclab-failed2/vendor/plugins/prawnto/lib/prawnto/template_handler/compile_support.rb:5)
D:/rails_proj/emclab-failed2/vendor/plugins/prawnto/lib/prawnto/template_handlers/base.rb:3:in `<module:TemplateHandlers>': uninitialized co
nstant ActionView::TemplateHandler (NameError)
Even rails server can not be started. Is there a way to fix this problem? thanks.
Prawn is a ruby gem and is not depending on prawnto to work with rails. Here is a post by aniket to use prawn directly in rails 3.2. We followed the instruction and it works in rails 3.2.8 as well. Check it out if you have the same compatible issue with prawnto.

what does omniauth 1.0.1 do?

I'm currently trying to use omniauth in my rails application. I was just curious, what does the omniauth 1.0.1 gem do now that the provider strategies come in separate gems like omniauth-facebook?
'omniauth 1.0.1' gem is core library.
'omniauth-facebook' gem is current provider implementation.
Docs

Rails 3.1: Do I need to use CoffeeScript?

Do I need to use CoffeeScript instead of JS in a Rails 3.1 app? The same goes for SASS and CSS.
thanks
No you don't. Just remove the coffeescript and sass gems in the Gemfile and you are good to go.