Cannot access 'humanized_money' in rails_admin #88

Closed
deiga opened this Issue Mar 11, 2013 · 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
RubyMoney member

@alup any ideas?

@alup
RubyMoney member

@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
RubyMoney member

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 Jun 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment