Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cannot access 'humanized_money' in rails_admin #88

Closed
deiga opened this Issue · 4 comments

3 participants

@deiga

Hey,

I assumed that the view helpers were available to mounted apps like rails_admin.

Is this is a problem of money-rails or rails_admin?

@semmons99
Owner

@alup any ideas?

@alup
Owner

@deiga Could you provide some more information of how to reproduce this? Helpers should be available in every template after app initialization.

@deiga

Well I guess my problem is that I don't call on humanized_money in a view. (at least I think so)
It's situated in the rails_admin initializer where I want to define how to output the value.

config.model 'Shop::Order' do
    configure :price, :decimal do
      pretty_value do
        humanized_money value + ' €'
      end
    end
end

Not sure how that method call actually works, but I either get MethdoNotFound or just the visual representation of the Money object when opening the show in rails_admin...

@alup
Owner

Since the humanized_money is a helper method, it is only available in ::ActionView::Base context. I suppose this is the reason you are getting this error. You should check how rails_admin handles ActionView helpers inside the configuration initializer.

I am closing this as invalid for now.

@alup alup closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.