{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/administrate/issues/391","repository_url":"https://api.github.com/repos/thoughtbot/administrate","labels_url":"https://api.github.com/repos/thoughtbot/administrate/issues/391/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/issues/391/comments","events_url":"https://api.github.com/repos/thoughtbot/administrate/issues/391/events","html_url":"https://github.com/thoughtbot/administrate/issues/391","id":125596485,"number":391,"title":"Record context within a field","user":{"login":"naps62","id":283819,"avatar_url":"https://avatars.githubusercontent.com/u/283819?v=3","gravatar_id":"","url":"https://api.github.com/users/naps62","html_url":"https://github.com/naps62","followers_url":"https://api.github.com/users/naps62/followers","following_url":"https://api.github.com/users/naps62/following{/other_user}","gists_url":"https://api.github.com/users/naps62/gists{/gist_id}","starred_url":"https://api.github.com/users/naps62/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naps62/subscriptions","organizations_url":"https://api.github.com/users/naps62/orgs","repos_url":"https://api.github.com/users/naps62/repos","events_url":"https://api.github.com/users/naps62/events{/privacy}","received_events_url":"https://api.github.com/users/naps62/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-08T11:49:21Z","updated_at":"2016-02-22T11:43:51Z","closed_at":"2016-02-22T11:43:51Z","body":"Is it possible to have a custom field whose presentation logic depends on the record that holds it?\r\n\r\nI was going through the documentation and the code, but from what I could see, the field has no knowledge of the record it's in\r\n\r\nTo clarify, I have a model where each record has a different monetary value & currency. I want to do two things:\r\n\r\n1. Show the currency symbol alongside the value (this could be done in a separate column, but that's not ideal)\r\n2. Show a different number of decimal places, depending on the currency (so Dollars or Euros would have 2 decimal places, but Bitcoins would have 8)"},"comment":{"url":"https://api.github.com/repos/thoughtbot/administrate/issues/comments/187136960","html_url":"https://github.com/thoughtbot/administrate/issues/391#issuecomment-187136960","issue_url":"https://api.github.com/repos/thoughtbot/administrate/issues/391","id":187136960,"user":{"login":"naps62","id":283819,"avatar_url":"https://avatars.githubusercontent.com/u/283819?v=3","gravatar_id":"","url":"https://api.github.com/users/naps62","html_url":"https://github.com/naps62","followers_url":"https://api.github.com/users/naps62/followers","following_url":"https://api.github.com/users/naps62/following{/other_user}","gists_url":"https://api.github.com/users/naps62/gists{/gist_id}","starred_url":"https://api.github.com/users/naps62/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naps62/subscriptions","organizations_url":"https://api.github.com/users/naps62/orgs","repos_url":"https://api.github.com/users/naps62/repos","events_url":"https://api.github.com/users/naps62/events{/privacy}","received_events_url":"https://api.github.com/users/naps62/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T11:43:51Z","updated_at":"2016-02-22T11:43:51Z","body":"@andrewhamon thanks for the help. I wasn't thinking about this in the correct way. The `value` field I have on my model is already an instance `Money` (from the [`money`](https://github.com/RubyMoney/money-rails) gem, but I was treating it as a raw number. Knowing it's a Money value, I can just do:\r\n\r\n```\r\nclass MoneyField < Administrate::Field::Base\r\n  def to_s\r\n    data.format\r\n  end\r\nend\r\n```"}}