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
3 answers

Friendly ID does not create new slugs on new inviations (devise-invitable)

When I invite a user in my Rails 4 app using devise-invitable, a new friendly id is not created by the app. I have the following code in my user.rb file extend FriendlyId friendly_id :name, :use => :slugged def should_generate_new_friendly_id? …
David Mckee
  • 1,100
  • 3
  • 19
  • 35
0
votes
4 answers

Friendly_id and Active Admin conflict - possibly because of revert_freindly_id

first time asking a question on stack overflow :) I'm having a conflict between friendly_id and active admin (it's an assumption), as discussed in many threads here. I've looked at all those threads, but I'm not entirely sure they solve my problem.…
harini
  • 21
  • 3
0
votes
1 answer

Can't get f.globalize_fields_for to appear using globalize 4.0.2 ruby gem

I'm using rails 4.1.4 and ruby 2.1.2, globalize 4.0.2, batch_translations 0.1.3 (I couldn't get f.globalize_fields_for to work any other way than use this gem), i18n 0.6.11 and friendly_id 5.0.1. In posts/_form.html.erb, I have…
Pavan Katepalli
  • 2,372
  • 4
  • 29
  • 52
0
votes
1 answer

Get Username in another model for friendlyId custom slug

I'm using FriendlyId. At the moment i build a custom slug this way: class Photo < ActiveRecord::Base extend FriendlyId friendly_id :photo_by_author, :use => :slugged def photo_by_author "#{title} by #{user_id}" end belongs_to :user end And…
Igor Martins
  • 2,015
  • 7
  • 36
  • 57
0
votes
1 answer

Self nesting rails categories

I have an store application, where I need to make custom routing system where URL stores categories for products. For example, http://example.com/languages/ruby/rails will display category#show named 'rails', that has parent named 'ruby', that has…
0
votes
1 answer

Rails friendly_id gem for pretty url

Is there a way to make friendly_id dynamic, something like the below, so that depending on an attribute in my user model (next_language) I can adjust how the url's look. I'm using devise. Ideally I would like the controller to handle this logic but…
mtcrts70
  • 35
  • 4
  • 19
0
votes
1 answer

scaling issues using friendly_id

Okay so I'm working on making a friendly_id that allows me to scale it effectively. This is what I got so far. What it does is essentially add +1 on a count if you have a matching name. So if you are the 2nd person to register as John doe your url…
sja
  • 347
  • 1
  • 10
0
votes
1 answer

Rails update() method causing error for custom URL

I am to create custom URLs for my Rails app. So far, I'm following the Friendy URLs documentation, as mentioned here https://gist.github.com/jcasimir/1209730. I've replaced the default slug (ie: /books/4 ) with an attribute of the model (ie:…
mhz
  • 1,019
  • 2
  • 8
  • 30
0
votes
1 answer

defining slug candidates from associated db with friendly_id

I have an Application.rb that belongs_to :company and the Company.rb can has_many :applications I've set up friendly_id on the Company model but also want it on my application. But the Application doesn't store what I want as slug_candidates. I…
user2755537
  • 151
  • 1
  • 9
0
votes
1 answer

Friendly_id 5 slug_candidates, how to use sequential numbering

The new version of friendly_id uses a slug_candidates method to create the slugged values appending a uuid if a duplicate is found, how do use this to get the old functionality? i.e matching records will be appended with 1,2,3 etc. def…
raphael_turtle
  • 7,154
  • 10
  • 55
  • 89
0
votes
1 answer

link_to helper method not working with friendlyId Gem in production

It's strange it works on my dev environment but when I deploy it continues to link to the product ID. I am using Rails 4.04 and the FriendlyId v5 Gem. On development when I do this: <%= link_to image_tag(product.photos.first.image.url(:feed)),…
asolberg
  • 6,638
  • 9
  • 33
  • 46
0
votes
1 answer

friendly_id and finding records by params

I am going to use friendly_if gem for pretty urls. I am able to get the nice looking urls. However, I all the code in the controller was getting records by id. like so: @image = Image.find(params[:id]) Do I need to start finding records by name…
bonum_cete
  • 4,730
  • 6
  • 32
  • 56
0
votes
1 answer

Which version of friendly Id gem to use with Rails 3.2.17

I added following line into my gemfile as mentioned on the 4_stable_branch read me gem "friendly_id", "~> 4.0.10" # Note: You MUST use 4.0.9 or greater for Rails 3.2.10+ and bundle install, it shows following message NOTE: FriendlyId 4.x breaks…
lightsaber
  • 1,481
  • 18
  • 37
0
votes
1 answer

Commenting on friendly_id posts in rails 4

I've just implemented friendly_id for my post urls but creating comments error with "No route matches {:action=>"show", :controller=>"posts", :id=>nil} missing required keys: [:id]" comments controller before_filter :authenticate_user! def create …
user2360003
0
votes
0 answers

Issues with Friendly_ID gem - possible issue with active admin

I ran the migrations as stated and added this to my model, but I keep generating the following error. Not really sure what is going on. My slug column in the photos table is full of unique values as well. Im running rails 4. Thanks for any…
vanilla_skies
  • 415
  • 5
  • 15