{"action":"created","issue":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/4619","repository_url":"https://api.github.com/repos/activeadmin/activeadmin","labels_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/4619/labels{/name}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/4619/comments","events_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/4619/events","html_url":"https://github.com/activeadmin/activeadmin/pull/4619","id":175762522,"number":4619,"title":"Decorators now receive the action name as context","user":{"login":"codyrobbins","id":145600,"avatar_url":"https://avatars.githubusercontent.com/u/145600?v=3","gravatar_id":"","url":"https://api.github.com/users/codyrobbins","html_url":"https://github.com/codyrobbins","followers_url":"https://api.github.com/users/codyrobbins/followers","following_url":"https://api.github.com/users/codyrobbins/following{/other_user}","gists_url":"https://api.github.com/users/codyrobbins/gists{/gist_id}","starred_url":"https://api.github.com/users/codyrobbins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codyrobbins/subscriptions","organizations_url":"https://api.github.com/users/codyrobbins/orgs","repos_url":"https://api.github.com/users/codyrobbins/repos","events_url":"https://api.github.com/users/codyrobbins/events{/privacy}","received_events_url":"https://api.github.com/users/codyrobbins/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-08T14:04:24Z","updated_at":"2017-01-26T21:05:24Z","closed_at":"2017-01-25T10:44:01Z","pull_request":{"url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/4619","html_url":"https://github.com/activeadmin/activeadmin/pull/4619","diff_url":"https://github.com/activeadmin/activeadmin/pull/4619.diff","patch_url":"https://github.com/activeadmin/activeadmin/pull/4619.patch"},"body":"I’ve found when using decorators that I often want to decorate a value differently depending on whether it's being displayed in a form or not. For example, dollar amounts might be stored in the database as decimal numbers and displayed on the index and show pages with a dollar sign and cents but should be rendered in the form without the dollar sign and no cents.\n\nDraper supports a context attribute for decorators and this change passes the current action name as the context when decorating resources. This will enable the decorator to decorate attributes differently depending on the page they are being shown on.\n"},"comment":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/comments/275513373","html_url":"https://github.com/activeadmin/activeadmin/pull/4619#issuecomment-275513373","issue_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/4619","id":275513373,"user":{"login":"codyrobbins","id":145600,"avatar_url":"https://avatars.githubusercontent.com/u/145600?v=3","gravatar_id":"","url":"https://api.github.com/users/codyrobbins","html_url":"https://github.com/codyrobbins","followers_url":"https://api.github.com/users/codyrobbins/followers","following_url":"https://api.github.com/users/codyrobbins/following{/other_user}","gists_url":"https://api.github.com/users/codyrobbins/gists{/gist_id}","starred_url":"https://api.github.com/users/codyrobbins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codyrobbins/subscriptions","organizations_url":"https://api.github.com/users/codyrobbins/orgs","repos_url":"https://api.github.com/users/codyrobbins/repos","events_url":"https://api.github.com/users/codyrobbins/events{/privacy}","received_events_url":"https://api.github.com/users/codyrobbins/received_events","type":"User","site_admin":false},"created_at":"2017-01-26T21:05:24Z","updated_at":"2017-01-26T21:05:24Z","body":"Thanks for the tip regarding access to the action name from the helper object inside the decorator—I wasn’t aware of that and that obviates the immediate need I had for this change!"}}
{"actor":{"display_login":"codyrobbins"}}