Rails Devise: get object of the currently logged in user?

Devise creates convenience methods on the fly that represent your currently logged user. However you should note that the generated method name includes the class name of your user model. e.g. if your Devise model is called ‘User‘ then the currently logged in user can be accessed with ‘current_user‘, and if your Devise class is … Read more

Rails 3.1: Engine vs. Mountable App

I have noticed the following: Full Engine With a full engine, the parent application inherits the routes from the engine. It is not necessary to specify anything in parent_app/config/routes.rb. Specifying the gem in Gemfile is enough for the parent app to inherit the models, routes etc. The engine routes are specified as: # my_engine/config/routes.rb Rails.application.routes.draw … Read more

Rails 2.3-style plugins and deprecation warnings running task in Heroku

Are you using Heroku? Heroku will inject plugins in Rails 3.x applications .. To avoid this injection in Rails 3, include the rails_12factor gem in your application. (Heroku Ruby Support 2013-10-26) The rails_12factor gem is also required in rails 4. If this gem is not present in your application, you will receive a warning while … Read more

execJs: ‘Could not find a JavaScript runtime’ but execjs AND therubyracer are in Gemfile

Ubuntu Users: I had the same problem and I fixed it by installing nodejson my system independent of the gem. on ubuntu its: sudo apt-get install nodejs I’m using 64bit ubuntu 11.10 update: From @Galina ‘s answer below I’m guessing that the latest version of nodejs is required, so @steve98177 your best option on a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)