Re: [Rails] Re: [QUESTION] How to have different routes ids on different routes for the same resources?

2017-04-21 Thread Maurizio De Santis
> > resources :posts, param: :slug FWIK this just changes the name of the parameter passed to the controller, so if you write post_path(Post.first) you will have a request like /posts/#{post.to_param} but in the controller instead of have param[:id] you have param[:slug] -- Maurizio De

[Rails] Re: [QUESTION] How to have different routes ids on different routes for the same resources?

2017-04-20 Thread Maurizio De Santis
I have to say that Rails is great. 5.1 introduces a wonderful feature for my need: direct http://edgeapi.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/CustomUrls.html#method-i-direct Now in config/routes.rb I can write: # Content model includes FriendlyId, so

[Rails] [QUESTION] How to have different routes ids on different routes for the same resources?

2017-03-21 Thread Maurizio De Santis
Hello, I have never found a good solution for the following problem. I have the usual structure: resources :contents namespace :admin do resources :contents end When I call content_path(content) I want the id to be the slug of the content, while when I call admin_content_path(content) I

[Rails] [Show RoR] Ruby and Ruby on Rails merged documentations

2014-04-23 Thread Maurizio De Santis
Hello, I just almost completed this project: http://mdesantis.github.io/ruby-rails-documentations/ It provides Ruby and Ruby on Rails documentations merged together, like railsapi.com used to do (it is online no more). Feel free to share your opinions about it. Cheers -- You received this

[Rails] Developing a web chat using Rails 3

2010-09-04 Thread Maurizio De Santis
Hi! I'm trying to develop a web chat (like the facebook one, but much simpler) that works inside Rails 3, and so I'm inquiring about the methods used for this scope. I had some success applying this guide http://www.web2media.net/laktek/2010/02/16/building-real-time-web-apps-with-rails3/ , so now

[Rails] Re: setting the size of a textarea

2010-08-02 Thread Maurizio De Santis
Tim Shaffer wrote: It's possible you have a style that is overwriting the rows and cols attribute. For my experience, it's better to not use rows and cols for dimensioning textareas, because the dimensions of the textarea will depend from the dimensions of the row and of the column, that rely