14 Nov '13, 1am

Still finding new rails methods regularly. Todays find was polymorphic_url and polymorphic_path.

Constructs a call to a named RESTful route for the given record and returns the resulting URL string. For example: # calls post_url(post) polymorphic_url ( post ) # => "http://example.com/posts/1" polymorphic_url ([ blog , post ]) # => "http://example.com/blogs/1/posts/1" polymorphic_url ([ :admin , blog , post ]) # => "http://example.com/admin/blogs/1/posts/1" polymorphic_url ([ user , :blog , post ]) # => "http://example.com/users/1/blog/posts/1" polymorphic_url ( Comment ) # => "http://example.com/comments" Options :action - Specifies the action prefix for the named route: :new or :edit . Default is no prefix. :routing_type - Allowed values are :path or :url . Default is :url . Examples # an Article record polymorphic_url ( record ) # same as article_url(record) # a Comment record polymorphic_url ( record ) # same as comment_url(record) # it recognizes new records and m...

Full article: http://apidock.com/rails/ActionDispatch/Routing/Polymorph...

Tweets

What's New in Ruby? What's New in Rails? New Li...

rubyflow.com 10 Nov '13, 1pm

What's New in Ruby? What's New in Rails? New Lists (Wiki Pages on GitHub) for Finding Web Sites Posted by geraldbauer on N...

Onde acompanhar notícias do mundo Ruby e Rails?...

rubyflow.com 14 Nov '13, 3pm

What's New in Ruby? Or in Rails? New Link Lists (Wiki Pages on GitHub) for Finding News Sites Posted by geraldbauer on Nov...

The Common Methods of Hardware Hacking via @zite

The Common Methods of Hardware Hacking via @zite

sparkfun.com 14 Nov '13, 5pm

If you’re looking to hack a piece of hardware, how you approach the hack depends on what you’re trying to do. Are you tryi...

Introducing the new Opportunities tab: find mor...

adwords.blogspot.com 13 Nov '13, 5pm

in 2009 as your personal AdWords assistant, surfacing insights to help you improve your performance in AdWords. Today we’r...