Questions tagged [friendly-id]

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.

The project on github

496 questions
0
votes
2 answers

RoR: friendly_id unique for user

I have a website that has works on the premise: example.com/user_id/news/slug-for-article By default, I have enabled unique slugs for articles, however I would like to have slugs unique per user, across all users. The non-uniqueness is handled by…
Ashley
  • 5,939
  • 9
  • 39
  • 82
0
votes
2 answers

Translate FriendlyID slugs to a corresponding ID

I have a comments scaffold and a movies scaffold. Users can comment on movie in this path /movies/the-social-network/comments/new My issue is that the comments use movie_id to work and to link with the movies. So what I'm asking is how to pass…
PMP
  • 231
  • 6
  • 25
0
votes
1 answer

undefined method `event_id' when using a belongs_to/has_many association

I'm creating a site that has events. Each event acts as a gallery and has_many images. Each image belongs_to and event. I followed the RailsCast #253 CarrierWave gem. When I try to add a new image, it says undefined method `event_id' for #…
0
votes
2 answers

Rails Friendly id Fullstops

I am using Friendly id to allow custom queries, from the username, in my Rails app. So say the User's username is loremipsum rails would display this http://localhost:3000/users/loremipsum, and this works perfectly fine but say the User's username…
PMP
  • 231
  • 6
  • 25
0
votes
1 answer

Rails FriendlyId with URLs within URL

My app caches web pages On pages#new, when you submit a URL (without the http:// prefix) a page is created and you're redirected to the show, something like pages/4 where 4 is the ID I'm trying to add friendly_id but am running into issues after…
R u c k s a c k
  • 784
  • 6
  • 17
0
votes
1 answer

FriendlyId suggest

I want to use FriendlyId to achieve this localhost3000/users/edu/profile but I do not know how to do it! I have these models User and UserProfile class User < ActiveRecord::Base has_one :user_profile, :dependent => :destroy extend FriendlyId …
edudepetris
  • 714
  • 14
  • 27
0
votes
1 answer

Ruby on Rails generate routing

I am trying to generate routes in my rails app. The app has Movie table and column genre. I want to make the routes like this: /movies-genre-horror and shows all the movies with genre horror. Is it actually possible? If yes, can anyone give a hint…
ishwr
  • 725
  • 3
  • 14
  • 36
0
votes
1 answer

friendly_id and routes.rb - rails

I'm currently using friendly_id gem in rails and noticed that if someone names a post "About" that it overwrites the /about path that I have assigned to a static page in my routes.rb file. This is my current code: extend FriendlyId friendly_id…
user749798
  • 5,210
  • 10
  • 51
  • 85
0
votes
2 answers

modify friendly_id gem

I want to be able in browsing bar see full path to some product. The path would look like this www.mysite.com/categories/category_name/subcategory_name/product_name At this moment I have just www.mysite.com/categories/category_name It just…
Edgars
  • 913
  • 1
  • 19
  • 53
0
votes
1 answer

Couldn't find Model with id=assets

I'm testing my application using rspec and poltergeist/phantomjs, and after I installed the gem friendly_id to change my default routes, all my javascript tests started to throw this error: Failure/Error: Unable to find matching line from…
0
votes
1 answer

FriendlyID doesn't build HTML escaped slugs

I have friendly_id setup properly and everything works, using slugs. The issue I am having is that some of the names on my Tag model (which is the model that FriendlyId is attached to) need to be HTML escaped. Names like c++ or .net. When I ran…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
0
votes
3 answers

Rails: ActiveAdmin doesn't work with Friendly_id

I have ActiveAdmin set up to manage the users on the site, and Friendly_id for readable urls. When I go to /admin/users, it throws this error: Undefined method `per' for # How friendly_id is…
Ryan Dao
  • 321
  • 1
  • 4
  • 13
0
votes
1 answer

how to display path with FriendlyId, rails

My task is to be able to see the path of the current category or product in browsing bar. At this moment I just can see current category like this localhost:3000/categories/smalcinataji but I want like…
Edgars
  • 913
  • 1
  • 19
  • 53
0
votes
1 answer

Use FriendlyId generator in model

Is there a way to access the FriendlyID slug generator from an instance of a model that extend FriendlyId? And then pass it a string to have a unique slug generated?
Nima Izadi
  • 996
  • 6
  • 18
0
votes
2 answers

How do I make friendly_id gem use an attribute from another model?

Currently using friendly_id on my messages table. Messages are accessed like this: site.com/messages/id e.g. site.com/messages/8 I'd like to use it like this: site.come/messages/username e.g. site.com/messages/terrytibbs I've got the gem working…