Ruby in Rails
  • Home
  • Rails
  • Ruby
  • About
GitHub icon LinkedIn icon
Subscribe
akshay

Akshay Mohite

Hi there! I am a Ruby on Rails & ReactJS Enthusiast, building some cool products at DTree Labs.

129 posts •

Override Devise Mailer in Rails

The other day, I had to override devise confirmation instructions email. Particularly, subject of the email being sent out from Devise. Devise makes it easy to override subject of the mail, with devise.en.yml

Akshay Mohite Akshay Mohite 3 min read

Override as_json in Rails

When we call as_json on ActiveRecord model object, it returns json of attributes on model by calling as_json. We can override as_json method and add extra attributes, rename keys, add values of methods

Akshay Mohite Akshay Mohite 3 min read

Postgres reset sequence to max ID in Rails

When we import rows in postgres table or restore data, sometimes sequence ID for the table is not maintained. Primary key sequence does not get updated. In postgres, we can reset sequence to

Akshay Mohite Akshay Mohite 2 min read

Rails Routes member vs collection

Rails routes on resources support member routing as well as collection routing. Member routes act on a member of the resource. Collection routes acts on resources in general.

Akshay Mohite Akshay Mohite 2 min read

Ruby single splat / double splat arguments

Splat operator or start (*) arguments in Ruby define they way they are received to a variable. Single splat operator can be used to receive arguments as an array to a variable or

Akshay Mohite Akshay Mohite 4 min read

Rails logger debug block vs string argument

Rails debugger allows method call either with a block or a string argument. Passing string in a block gets evaluated only when it is needed. Both perform the same task of writing something

Akshay Mohite Akshay Mohite 2 min read
« Newer Posts Page 3 of 22 Older Posts »
Ruby in Rails © 2022
Latest Posts Github Twitter LinkedIn

Subscribe to Ruby in Rails

Stay up to date! Get all the latest posts delivered straight to your inbox