Skip to content

Instantly share code, notes, and snippets.

@r3cha
r3cha / create_items.rb
Last active April 6, 2019 20:54
How to generate friendly urls without overhead of friendly id and etc.
# db/migrate/create_items.rb
# if you use activerecord
class CreateItems < ActiveRecord::Migration
def change
create_table :items do |t|
t.string :title
t.string :slug
t.timestamps
end
end
@r3cha
r3cha / r-img_example
Last active April 2, 2019 09:49
place r-img tag in your html
<div class="image_area">
<r-img image-hash="hashWithImageUrls" bg-position="center">
</div>