> On Jan 26, 2019, at 5:27 PM, fugee ohu <[email protected]> wrote:
> 
> TypeError: no implicit conversion of Symbol into Integer
> from app/models/press_release.rb:17:in `truncated_headline'
> 
> 
> class PressRelease < ApplicationRecord
> 
>   extend FriendlyId
>   friendly_id :truncated_headline, use: :slugged
> 
>          
>   def truncated_headline 
>   # cut off at 200 characters, without an ellipsis 
>       headline.truncate(255, '') 
>   end 
> 

Aha. truncate takes named arguments past the first one. The correct signature 
is 

headline.truncate(255, omission: '')

This should work.

Walter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/8D6F2BBA-54B6-45EA-998E-ABD1AF7D3D6B%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to