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

Cannot update objects via rails console (or through my app) ... but no specific errors to help debug

here's what I tried to do: irb(main):008:0> c.title = "Another Test" => "Another Test" irb(main):009:0> c.save (0.7ms) BEGIN FriendlyId::Slug Load (1.0ms) SELECT "friendly_id_slugs".* FROM "friendly_id_slugs" WHERE…
Ringo Blancke
  • 2,444
  • 6
  • 30
  • 54
0
votes
2 answers

Caching friendly_id plugin

Class Product < ActiveRecord::Base has_friendly_id :name, :use_slug => true end What is the most efficient method to store the slugs within the 'products' table. I have complex find queries, and the joins with the 'slugs' table give me…
astropanic
  • 10,800
  • 19
  • 72
  • 132
0
votes
1 answer

heroku error uninitialized constant User::FriendlyId

Im having a weird problem on heroku, this is the error I get: Im using rails 3.2.8, ruby 1.9.3, with active admin, friendly id! /app/app/models/user.rb:2:in `': uninitialized constant User::FriendlyId (NameError) On my local…
maumercado
  • 1,453
  • 4
  • 23
  • 47
0
votes
1 answer

friendly_id 4.0.8 with rails 3.0.1 rails generate friendly_id not working?

I am using friendly_id 4.0.8 with rails 3.0.1. I want to use the history feature. When I type the command rails generate friendly_id, it fails with the following error message: [WARNING] Could not load generator "generators/friendly_id_generator".…
ami
  • 81
  • 1
  • 5
0
votes
1 answer

Model and controller designs in rails for friendly URL

Another question from rails newbie. I am using friendly_id gem with mysql in rails 3.x This is a design problem (may be easy in rails). I am expecting advises from rails experts. I am building a library listing app. Where user can view library by…
JVK
  • 3,782
  • 8
  • 43
  • 67
0
votes
1 answer

Rails Factory Girl RSpec Testing Has-Many Relationship of Nested Resources

Note: A business has many catalogs and has products, and a catalog has many products. The associations are properly defined and they are working in the application front end. But I can't make this test pass. I am using friendly_id so you will see me…
yretuta
  • 7,963
  • 17
  • 80
  • 151
0
votes
1 answer

Rails3 nested routes with default base

From the example in rails guides, routes like: resources :publishers do resources :magazines do resources :photos end end Will lead to, URLs like: /publishers/1/magazines/2/photos/3 I want to have slugs for publishers for example -…
whizcreed
  • 2,700
  • 3
  • 22
  • 35
0
votes
1 answer

User.find('123-foobar') will return User with id 123

I've asked at github, but will try asking here as well. Nothing wrong with being "resourceful" ;-). Using friendly_id 4. I created a user with slug => "123 foobar". This user has an id of 200. When doing User.find('123-foobar'), it returns the user…
Christian Fazzini
  • 19,613
  • 21
  • 110
  • 215
0
votes
1 answer

Creating URL slugs for tags with acts-as-taggable-on using friendly_id

I'm trying to follow the answer on this question in order to create url friendly slugs for tags: Creating url slugs for tags with acts_as_taggable_on In initalizers I have: ActsAsTaggableOn::Tag.class_eval do extend FriendlyId friendly_id :name,…
-1
votes
2 answers

(Friendly_id) How to use slug instead of id in nested routes?

I have two models - Team and Campaign. Team has_many :campaigns & Campaign belongs_to :team Using friend_id gem, I have my team routes working as expected i.e https://localhost/t/myteam However, for campaign_path(@campaign.team, @campaign) my url…
HighOnRails
  • 43
  • 2
  • 7
-1
votes
1 answer

ActiveRecord::RecordNotFound (Couldn't find Employer without an ID) while using form Rails 5

I checked various solutions that are available, but none seem to address the issue that I am having with my project. I am trying to allow the user to create reviews through the EmployerReview model for the employer. When I pass the employer_id to…
-1
votes
1 answer

What is this error ActiveRecord::StatementInvalid in ArticlesController#show?

error : SQLite3::SQLException: no such column: articles.slug: SELECT "articles".* FROM "articles" WHERE "articles"."slug" = '33' ORDER BY "articles"."id" ASC LIMIT 1 code : def show @article = Article.friendly.find(params[:id]) @category =…
-1
votes
1 answer

Ruby on Rails - Friendly-ID - Id is processed as slug on destroy method

everything is working fine apart from the destroy method for my user model. I'm FAIRLY sure now that it has something to do with the Friendly_ID gem. If I require a password then i get an error of invalid password. If I don't require a password…
Rob Hughes
  • 876
  • 2
  • 13
  • 32
-1
votes
1 answer

undefined method `paginate' for #

im using rails 4 and will_paginate and friendly_id source 'https://rubygems.org' gem 'rails', '4.2.6' gem 'friendly_id', '~> 5.1.0' gem 'sorcery' gem "paperclip", "~> 4.3" gem 'will_paginate', '3.0.7' gem…
anouar
  • 125
  • 1
  • 1
  • 10
-1
votes
2 answers

using a 301 redirect to maintain SEO

I'm currently using freindly_id gem in a rails application to slug URLs and make them look nice. So rather than the URL #root/cities/1234 they are #root/cities/#cityname We are looking to change the cityname part of the URL to something else and it…
1 2 3
33
34