{"id":26,"date":"2008-06-28T22:07:07","date_gmt":"2008-06-29T04:07:07","guid":{"rendered":"http:\/\/sha.nnoncarey.com\/blog\/?p=26"},"modified":"2008-06-28T22:07:07","modified_gmt":"2008-06-29T04:07:07","slug":"rails-inconsistency","status":"publish","type":"post","link":"https:\/\/sha.nnoncarey.com\/blog\/archives\/26","title":{"rendered":"Rails inconsistency"},"content":{"rendered":"<p>I like Ruby on Rails, but the design is sometimes inconsistent.<\/p>\n<p>For example, consider the &#8220;text_method&#8221; parameter to the <code>collection_select<\/code> helper method.  The argument forces you to call a method on the model object which returns the text which is used in the select list.  That&#8217;s ok when you only want to display a single field from that object, for example &#8220;name&#8221;.  It&#8217;s not ok if you want to display something more complicated, because then you&#8217;re putting display logic into the model.  You&#8217;re supposed to use helpers for that!  Since doing it right would make it ugly and more complicated, I end up giving in and doing it the wrong way by adding a method to the model.  It frustrates me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I like Ruby on Rails, but the design is sometimes inconsistent. For example, consider the &#8220;text_method&#8221; parameter to the collection_select helper method. The argument forces you to call a method on the model object which returns the text which is used in the select list. That&#8217;s ok when you only want to display a single &hellip; <a href=\"https:\/\/sha.nnoncarey.com\/blog\/archives\/26\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Rails inconsistency&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":0,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"wp:attachment":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}