there is some case we have to reuse a helper method to produce an html output...
in my form view , I am calling a user_helper method fees_string() to output a specific string based on user membership
%span#academy_analysis_fees = fees_string( 1, @academy_account_type )
but on changing a dropdown value , I need to modify this fee string, with an Ajax request change_language
in my user_controller.rb ..... def change_language # POST js request...... account_type = new academy_account_type # get the new account type
# I should be able to call the fees_string() method to get an html string used in my change_language.js.erb # rather than rebuilding the string fees_string = (account_type.locale[:currency_symbol] + " " ...........
this runs well but is there any way to reuse the helper method... cannot reuse it in the .js.erb