Rails applications that deal with STEEM account names.

in #rails7 years ago (edited)

Just a quick note about rails apps that deal with STEEM account names. Some accounts contain a period (.), which causes rails apps a bit of trouble. This is because the default for rails apps is to assume that account names containing a period are expressing a format. So an account name of foo.bar is handled as foo with the format of bar.

This can be fixed in Rails 5 using the following route:

Rails.application.routes.draw do
  resources :accounts, id: /([^\/])+/, only: [:index, :show]
end

Or, if you're not on Rails 5 yet, add a question mark:

Rails.application.routes.draw do
  resources :accounts, id: /([^\/])+?/, only: [:index, :show]
end
Sort:  

Thanks for the technical aspects of addressing this matter. Always good to have someone point out issues that other have encountered and a way of fixing them. That's the true meaning of the steemit belief to help the others and grow together.

Yeah, this is a pretty old problem and I just encountered it again recently so I thought I'd document it.

Thx for the info.. Also on my list to try once but the list is getting longer each week.. and i am not that deel into this kind of software😉

Hey great work on integrating Ruby with steem, I hope we speak soon. I messaged you on Steemit.chat

wow thats new to me, its really nice to have someone like you who teaches us all things like this. It shows how much you care to this community... this is really interesting to us all. great work

thanks for sharing..

Thanks for the good info and caring about the Steemit community to post this update!

Thanks for the high-tech aspect of addressing this matter. Is always good to have someone fishing out problems that others have faced and providing solutions to it. That's the real meaning of Steemit and to help other and move up together

Happy new year! Great work! I appreciate all your contribution to steemit.

I saw your name on @crowdfundedwhale, can you help me if you know personally @cryptos, because he didnt online for many days, thank you!

I love it when someone finds a gotcha before I encounter it and solves it before I have to spend hours on it. Thanks a lot for this, and your contributions to the Steem/Ruby ecosystem!