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
1
vote
1 answer

creating a custom path-helper while using FreindlyID

we're trying to get our site to have less scrapeable AND more readable urls so e.g. www.loomio.org/discussions/3122 becomes www.loomio.org/d/3saA4ds9/lets-go-to-the-moon we only really want the human-readable slug on show-links, so…
mix
  • 13
  • 2
1
vote
1 answer

undefined method `friendly' for #

I recently installed friendly_id 5 on my Rails 4 app. I've followed the quick start guide, and setup a model like this: class Official::Master < Official extend FriendlyId friendly_id :name, use: [:slugged, :history] end When I try to save an…
nullnullnull
  • 8,039
  • 12
  • 55
  • 107
1
vote
1 answer

How can I use slug candidates with frienldy_id and simple_i18n

In a Rails4 app, I use friendly_id 5.0.1 with the plugin simple_i18n with two locales en and de. In my model, I have name_de, name_en and title_de, title_en (and of cause slug_de, slug_en). When saving the model, I used to set both slugs in a…
Martin M
  • 8,430
  • 2
  • 35
  • 53
1
vote
1 answer

Friendly_id-globalize 'find() through' association isn't using translation table

In Rails 4: Using find() directly on my model generates a query which looks up the slug in the page_translations table: Page.find('my-title') SELECT FROM "pages" LEFT OUTER JOIN "page_translations" ... -> # When I use find through a…
David
  • 937
  • 1
  • 12
  • 22
1
vote
2 answers

How to use a friendly id only in one namespace

I'm using the gem friendly_id in rails 4 to make nice urls for my user's product listings. It works by overriding the to_param. Now it is working wonderfully in the Shop namespace which is the public facing part of my site however in the Admin…
hadees
  • 1,754
  • 2
  • 25
  • 36
1
vote
1 answer

ERROR: Error installing friendly_id: activesupport requires Ruby version >= 1.9.3. with Rails2.3.3 and Ruby 1.8.7

When I try to install friendly_id :version => "~> 3.0.6" with rails 2.3.3 wtih ruby 1.8.7 getting error for Ruby version ERROR: Error installing friendly_id: activesupport requires Ruby version >= 1.9.3. Current version of Rails is 2.3.3 and Ruby…
Vijay Chouhan
  • 4,613
  • 5
  • 29
  • 35
1
vote
1 answer

generate slug url using rails 4

Based on this tutorial, I've created a slug url but when I click show or add post it showing error as : ActiveRecord::RecordNotFound Couldn't find Post with id=testing-seo-url Instead of taking slug it is taking as id. where I have to make changes…
Prabhakaran
  • 3,900
  • 15
  • 46
  • 113
1
vote
1 answer

friendly_id gem with rails, converting to SEO friendly urls

I'm using friendly_id and rails 3.2. I'm trying to convert a products table to have clean urls. I'm having no issues using the new slug column, and urls are generating fine like example.com/products/new-friendly-url The problem I am running…
stonep
  • 309
  • 4
  • 22
1
vote
0 answers

Monkey patching a Gem method in Rails 3

I'm willing to use friendly_id gem with Firebird, but I need to override a method that implements a specific SQL function with code related to Firebird. I've created the file config/initializers/friendly_id_monkey_patch.rb containing the following…
1
vote
2 answers

friendly_id gem using associated model fields

What should we do if we have to generate slug for a model when its associated records are updated. For example I am using models User and UserProfile and the slug is user.user_profile.name. When a new user is created the associated user_profile is…
rashila
  • 91
  • 4
1
vote
1 answer

Rails: FriendlyId gem not working

I was trying to install gem FriendlyId. I am following railscast: 314-pretty-urls-with-friendlyid. It seems pretty easy to install. But not working for me. Here are the steps I did: added gem "friendly_id", "~> 4.0.9" in Gemfile I then ran bundle…
user2206724
  • 1,265
  • 3
  • 20
  • 38
1
vote
1 answer

Change Friendly_ID Sequence Number Rails

Out of the box, Friendly_ID adds "--2", "--3"... to the end of the slug when an similar entry exists. I see where I can change the "sequence_separator" but am having having trouble finding what I would call the "sequencer." My posts will only…
timroman
  • 1,384
  • 1
  • 10
  • 18
1
vote
1 answer

friendly_id: Renew slugs optionally

I want to allow users to renew the slug of an entry by clicking a checkbox. I know the function should_generate_new_friendly_id? , but not how to use it in this case since it is defined in the model and cannot read params attributes. Thanks for any…
Railsana
  • 1,813
  • 2
  • 21
  • 30
1
vote
1 answer

Problems with FriendlyId and parameters

I am trying to change my urls from whatever.com/users/1 to whatever.com/users/jamie.Surname or whatever.com/users/jamie-Surname I would quite like to eventually change to whatever.com/jamie.surname or whatever.com/jamie-surname but I thought it…
Eieio
  • 109
  • 3
  • 15
1
vote
1 answer

`friendly_id` doesn't allow delete

I'm using friendly_id to make my URL's more user friendly, but since implementing the gem, my destroy action just goes to the show action. I'm currently using: = link_to 'Delete', entry_path(e), :method => :delete, :confirm => 'Really really?' and…