Rustam A. Gasanov

$ echo "Inspired developer's blog" > /dev/null

Dynamic Session Time Management With Devise

| Comments

From the box Devise has 2 options to manage sessions: rememberable and timeoutable. rememberable utilizes database to store the time when user was signed in and compares it with current time - if the difference is more than config’s remember_for setting the user will be signed out. timeoutable first checks if rememberable is being used and not expired, then compares current time with last user’s request time - the difference is then being compared with config’s timeout_in setting. What if you want to have multiple timeout_in settings for different cases?

How to Use ERB With ECO

| Comments

In my current project we use Rails with Backbone(Marionette). For Rails, it’s essential to use .erb. For Backbone, we use .jst.eco. Everything works fine unless you need Ruby helpers(asset_url/asset_path for example) in JavaScript templates. Here I’ll show how to combine the power of erb and eco template engines.