500 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
81
views
Inconsistent behavior of route helpers with friendly_id [closed]
I have added friendly_id to a rails project and despite everything working as expected, one test is broken and I cannot figure out why:
The model in question is called species, so with slugs generated ...
0
votes
2
answers
90
views
How to free up friendly_id slugs when destroying a record?
My Page model has a slug column using FriendlyId, with the history option turned on.
I want to free slugs so that if a page with this slug is destroyed, then recreated, it can reuse the same slug.
...
0
votes
1
answer
79
views
Get slug to update when attribute of association changes
I have Attraction and Venue models. Their associations are:
Attraction
belongs_to :venue
Venue
has_many :attractions, dependent: :nullify
I'm using the friendly_id gem to add slugs to both. They ...
0
votes
1
answer
54
views
Is there a way to turn of friendly_id or at least the history module during testing?
I have a Rails application where I added the friendly_id with the history module enabled and performance during tests plummeted. I'm talking about going from 15 minutes to 30 minutes in the absolutely ...
0
votes
1
answer
688
views
Rails Posgres db: WARNING: unrecognized node type: 112
I am getting the following error in the production version of my Rails Postgres db:
WARNING: unrecognized node type: 112
It only happens in production, on basic console commands, such as .find, and ...
0
votes
2
answers
136
views
How do i solve friendly id issue in active admin
I am using Rails 7 Active admin
I have Project that is Workshop Project that is related to organizing workshops, booking them etc.
I am using Friendly ID Gem . The url looks like http://127.0.0.1:3000/...
0
votes
1
answer
69
views
Redirect to the canonical slugs using FriendlyId gem while using CanCan gem
Let's say you have a model Speaker that utilizes FiendlyId gem to create unique slugs like this:
class Speaker < ApplicationRecord
friendly_id :name, use: %i[slugged history finders]
end
And you ...
0
votes
1
answer
87
views
Rails Undefined method `friendly_id' using friendly_id gem
I've looked at similar posts on SO and YouTube videos, but can't seem to figure out why I'm getting this error for a blog site:
undefined method `friendly_id' for BlogPost:Class
Ideally, my URL ...
0
votes
2
answers
84
views
Why is my custom slug method skipping it's code?
I am trying to perform the following actions to alter my urls:
parse instances of "an-" from my url
remove a prefix of "the-" from my url if present.
class BlogPost < ...
0
votes
1
answer
195
views
How to add the name of a blog post's category to route url with Rails 7
I have been trying to add the name of the BlogCategory that a BlogPost belongs to in a URL such as this:
sitename.com/blog/category-name/blog-post-title
At the very least, I want this to render for ...
0
votes
0
answers
120
views
ActiveRecord::RecordNotFound Issue in Rails
I see the above issue while accessing active admin show page for model "campaign". This might be due to friendly_id gem, but I'm unable to identify what exactly the issue is.
My campaign.rb ...
1
vote
1
answer
73
views
When using the friendly_id gem - can you ignore certain routes like /about /contact?
I'm using the friendly_id gem in a Rails application, to be able to view organisations at site.com/organisation-name
The problem is that I have a few static pages like "About" and "...
1
vote
2
answers
300
views
Rails friendly_id gem not working with link_to helpers?
I’ve set the friendly_id gem up, and generated slugs for my model.
The slugs are all shown in my DB column, and if I run Event.friendly.find('my-event-name') in the console, it works perfectly.
My URL’...
1
vote
1
answer
174
views
Modified ID in URLs to avoid guessing different integer IDs in Rails
I am asking almost to the same question asked here: Encrypted ID in URLs
Only I don't necessarily need the ID encrypted, I use a random string code. And I have tried a similar solution to what João ...
1
vote
2
answers
206
views
My normalize_friendly_id override is never called
I am very new to friendly_id and it matches my need to provide friendly URLs 👍
I have a Group model (i.e. a group of users) for which I generate a unique code upon creation. FYI, this code attribute ...