FriendlyId is the "Swiss Army bulldozer" of slugging and permalink plugins for Ruby on Rails. It allows you to create pretty URL's and work with human-friendly strings as if they were numeric ids for Active Record models.
Questions tagged [friendly-id]
496 questions
0
votes
0 answers
Rails: Programatically caching friendly urls on facebook when using friendly_id gem
I have a view page which has an embedded youtube video on it. I have the proper OG tags so that the video is embedded on facebook when shared.
But in order for above to work, I need to programatically hit the Facebook debugger endpoint so that my…

Jackson Cunningham
- 4,973
- 3
- 30
- 80
0
votes
1 answer
friendlyId won't work correctly
Im trying to apply friendlyId gem onto my rails app.
When I have done
1 : installing gem,
2 : and this
bin/rails g friendly_id
create db/migrate/20150220082838_create_friendly_id_slugs.rb
create config/initializers/friendly_id.rb
bin/rake…

Hirohito Yamada
- 387
- 1
- 4
- 17
0
votes
1 answer
Not any effect on friendly_id for friendly url
I use gem 'friendly_id', '~> 5.1.0' but not any effect on my id.
this is my work:
model:
extend FriendlyId
friendly_id :company_name, use: :slugged
Controller:
@company = Company.friendly_id.find(params[:company_id])
View:
<%=…
user5835902
0
votes
0 answers
Confusion in friendly_id instructions
the application has installed per gemfile.lock
friendly_id (5.1.0)
friendly_id-globalize (1.0.0.alpha2)
the base gem page states "As of version 5.0, Finders are no longer overridden by default. If you want to do friendly finds, you must do…

Jerome
- 5,583
- 3
- 33
- 76
0
votes
2 answers
How to stop friendly id from generating a numeric sequence to differentiate conflicting slug?
Say I have a uniqueness constraint on name inside its has_many association. This would mean I don't need the ugly numeric sequence added to conflicting slugs.
As an example 2 slugs might get the same name in a game db from 2 different people having…

Rob
- 1,835
- 2
- 25
- 53
0
votes
1 answer
Avoid slugging Certain Views with Friendly_ID
When using friendly_id, views that don't necessarily need to show the user's screen name are being displayed. For example. 127.0.0.1:3000/users/info.todacken333 How can I avoid showing the username on views like settings or edit…

Daniel W
- 73
- 9
0
votes
0 answers
How to configure sequence separator with underscore `_` of friendly_id gem
I am using the friendly_id gem version 3.3.3.0 in Rails 3.2
I have defined friendly id like following :-
class User < ActiveRecord::Base
has_friendly_id :name, use: :slugged, sequence_separator: '_', max_length: 32
end
I have used sequence…

Sampat Badhe
- 8,710
- 7
- 33
- 49
0
votes
1 answer
URL finding by email address not working with FriendlyId
I have the friendly_id gem installed (version 5.1.0) and have implemented the steps in the documentation to extend my model, add the slug field to the table, etc. This url works as expected:
http://localhost:3000/owners/1
I'm trying to find by…

tobinjim
- 1,862
- 2
- 19
- 31
0
votes
1 answer
Creating a Rails Migration to add a Friendly_id column (which is null) to a table with data
I have a table with data and I would like to add friendly_id.
I don't know how to build my migration as I can't create a table with :null=>false when there's data in it. What I would like to do, was for the migration to run the FriendlyId so it…

Tiago
- 673
- 1
- 8
- 24
0
votes
2 answers
How to make pretty url's with scopes using friendly_id?
I'm building a blog and I want my categories to have beautiful URL's like
blog/music, blog/art, etc.
So far, I've managed to make them look like this
/blog?category=music
class Article < ActiveRecord::Base
belongs_to :category
extend…

Billy Logan
- 2,470
- 6
- 27
- 45
0
votes
3 answers
No slug being added with friendly id rails
When i create a new category_item_key in the db the slug isn't being added to the slug column.
here is my coding
migration file
class AddSlugToCategoryItemKeys < ActiveRecord::Migration
def change
add_column :category_item_keys, :slug,…

Rob
- 1,835
- 2
- 25
- 53
0
votes
5 answers
Use Numeric Sequence for Duplicate Slugs [Friendly ID]
I noticed on the docs it says: Previous versions of FriendlyId appended a numeric sequence to make slugs unique, but this was removed to simplify using FriendlyId in concurrent code.
Is there any way to revert back to this format? My model only has…

Onichan
- 4,476
- 6
- 31
- 60
0
votes
1 answer
Rails FriendlyId for friendly url for category and subcategory
In Rails4 is it possible to have FriendlyId build out the complete url including categories and subcategories?
Example:
sitename/categories/6/subcategories/36/12
should be:
sitename/community/events/garage-sale-in-fresno
Community is the category,…

jrfent
- 13
- 3
0
votes
1 answer
Rails & FriendlyID gem: how to redirect resource path to new friendly URL
I'm using the friendlyID rails gem which is working great at generating a new friendly url slug. My issue is that users can still access the original resource path: mydomain.com/movies/2
How would I redirect the original resource path to the new…

Jackson Cunningham
- 4,973
- 3
- 30
- 80
0
votes
2 answers
How can I make a custom path for a model?
I'm using FriendlyID to make my URLs look nice, so what I got now is:
/items/my-personal-item
But what I would like is:
/user1/my-personal-item
Where user1 is the username of a user owning my-personal-item.

Cojones
- 2,930
- 4
- 29
- 41