{"action":"created","issue":{"url":"https://api.github.com/repos/jollygoodcode/jollygoodcode.github.io/issues/1","labels_url":"https://api.github.com/repos/jollygoodcode/jollygoodcode.github.io/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jollygoodcode/jollygoodcode.github.io/issues/1/comments","events_url":"https://api.github.com/repos/jollygoodcode/jollygoodcode.github.io/issues/1/events","html_url":"https://github.com/jollygoodcode/jollygoodcode.github.io/issues/1","id":96719825,"number":1,"title":"Ruby on Rails Helpers: h, j, l and t","user":{"login":"JuanitoFatas","id":1000669,"avatar_url":"https://avatars.githubusercontent.com/u/1000669?v=3","gravatar_id":"","url":"https://api.github.com/users/JuanitoFatas","html_url":"https://github.com/JuanitoFatas","followers_url":"https://api.github.com/users/JuanitoFatas/followers","following_url":"https://api.github.com/users/JuanitoFatas/following{/other_user}","gists_url":"https://api.github.com/users/JuanitoFatas/gists{/gist_id}","starred_url":"https://api.github.com/users/JuanitoFatas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuanitoFatas/subscriptions","organizations_url":"https://api.github.com/users/JuanitoFatas/orgs","repos_url":"https://api.github.com/users/JuanitoFatas/repos","events_url":"https://api.github.com/users/JuanitoFatas/events{/privacy}","received_events_url":"https://api.github.com/users/JuanitoFatas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jollygoodcode/jollygoodcode.github.io/labels/Blog","name":"Blog","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-23T03:26:04Z","updated_at":"2015-07-23T12:32:48Z","closed_at":null,"body":"# Ruby on Rails Helpers: h, j, l and t\r\n\r\nThere are four one-char Rails helpers that seasoned developers use all the time for their simplicity and expressiveness:\r\n\r\n## `h`, alias for `html_escape`\r\n\r\n`h` is a helper for escaping HTML tag characters. \r\n\r\nReference: http://api.rubyonrails.org/classes/ERB/Util.html#method-c-html_escape\r\n\r\n```\r\n> h(\"is a > 0 & a < 10?\")\r\n=> is a &gt; 0 &amp; a &lt; 10?\r\n```\r\n\r\n## `j`, alias for `escape_javascript`\r\n\r\n`j` is a helper for escaping carriage returns, single and double quotes in JavaScript to prevent malicious JavaScript from being executed via user's input.\r\n\r\nReference: http://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-escape_javascript\r\n\r\n```\r\n$('#comment-<%= @comment.id %>').html('<%= j render 'form', comment: @comment %>');\r\n```\r\n\r\n## `l`, alias for `localize`\r\n\r\n`l` is a helper for localizing `Date` and `Time` objects to local formats.\r\n\r\nReference: http://api.rubyonrails.org/classes/AbstractController/Translation.html#method-i-localize\r\n\r\n```\r\n<%= l(Time.current) %>\r\n# => \"Wed, 22 Jul 2015 16:35:27 +0800\"\r\n```\r\n\r\n## `t`, alias for `translate`\r\n\r\n`t` is a helper for looking up text translations.\r\n\r\nReference: http://api.rubyonrails.org/classes/AbstractController/Translation.html#method-i-translate\r\n\r\n```\r\n<%= t(\"site.title\") %>\r\n# => \"My Awesome Store\"\r\n```\r\n\r\n--\r\n\r\nThanks for reading! \r\n\r\n@JuanitoFatas :pencil2: [Jolly Good Code](http://www.jollygoodcode.com)"},"comment":{"url":"https://api.github.com/repos/jollygoodcode/jollygoodcode.github.io/issues/comments/124081357","html_url":"https://github.com/jollygoodcode/jollygoodcode.github.io/issues/1#issuecomment-124081357","issue_url":"https://api.github.com/repos/jollygoodcode/jollygoodcode.github.io/issues/1","id":124081357,"user":{"login":"hanmd82","id":761959,"avatar_url":"https://avatars.githubusercontent.com/u/761959?v=3","gravatar_id":"","url":"https://api.github.com/users/hanmd82","html_url":"https://github.com/hanmd82","followers_url":"https://api.github.com/users/hanmd82/followers","following_url":"https://api.github.com/users/hanmd82/following{/other_user}","gists_url":"https://api.github.com/users/hanmd82/gists{/gist_id}","starred_url":"https://api.github.com/users/hanmd82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanmd82/subscriptions","organizations_url":"https://api.github.com/users/hanmd82/orgs","repos_url":"https://api.github.com/users/hanmd82/repos","events_url":"https://api.github.com/users/hanmd82/events{/privacy}","received_events_url":"https://api.github.com/users/hanmd82/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T12:32:48Z","updated_at":"2015-07-23T12:32:48Z","body":":+1: @JuanitoFatas "}}