RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: seadaniel
Does slug support traditional Chinese character?
here is the code
class Article < ActiveRecord::Base extend FriendlyId friendly_id :name, use: :slugged end
Let's say I create an new article with Chinese title.
It seems friendlyId is unable to save the Chinese title in slug column. So the URL still show the id of the article.
If I do this
class Article < ActiveRecord::Base extend FriendlyId friendly_id :name end
It works but I have to ensure no duplicate name.
Any way to solve this?
@Bardwin
Your example works very well. Thank you!
How to show a notice like "no record match" when there is no match record according to the input value?
I am building this functionality into my projects.
I would like to have the order of all the parent messages from new to old and the order of child messages from old to new.
Here is my code
default_scope order: 'microposts.created_at DESC'
<%= nested_microposts @microposts.arrange(:order => :created_at) %>
the code in model/message.rb seems to override .arrange(:order => :created_at)
So the order of all the messages is from new to old and the nested function doesn't work.
Can I arrange the order of all the messages as what I say??
Does slug support traditional Chinese character?
here is the code
Let's say I create an new article with Chinese title.
It seems friendlyId is unable to save the Chinese title in slug column. So the URL still show the id of the article.
If I do this
It works but I have to ensure no duplicate name.
Any way to solve this?
@Bardwin
Your example works very well. Thank you!
How to show a notice like "no record match" when there is no match record according to the input value?
I am building this functionality into my projects.
I would like to have the order of all the parent messages from new to old and the order of child messages from old to new.
Here is my code
<%= nested_microposts @microposts.arrange(:order => :created_at) %>
the code in model/message.rb seems to override .arrange(:order => :created_at)
So the order of all the messages is from new to old and the nested function doesn't work.
Can I arrange the order of all the messages as what I say??