Ruby in Rails

Ruby, Rails, Ruby on Rails Tutorials

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

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

Rails ActiveRecord dup objects

Rails ActiveRecord supports duplicating objects in order to create new objects. Sometimes we need to create a duplicate copy of ActiveRecord object and update a few attributes and then save as a new

Akshay Mohite Akshay Mohite 5 min read

Rails routes concerns

Rails supports concerns in Routes. Concerns can be defined in Rails routes to be able to have reusable routes.

Akshay Mohite Akshay Mohite 2 min read
« Newer Posts Page 4 of 23 Older Posts »
Ruby in Rails © 2023
Latest Posts Github Twitter LinkedIn

Subscribe to Ruby in Rails

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