method
new
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
Register or
log in
to add new notes.
carlos_roque -
April 17, 2018
![Default_avatar_30](https://www.gravatar.com/avatar/5226311ea9ba44d7e34180a3aa18457c?default=http://apidock.com/images/default_avatar_30.png&size=30)
0 thanks
When using ActionView::Base.new to render templates views
when calling this method to render templates to a string. in order to use any helper methods you need to add them to the view like this
view = ActionView::Base.new(ActionController::Base.view_paths, {}) view.class_eval do # include any needed helpers (for the view) include ApplicationHelper end
source: http://peden.biz/rendering-a-rails-view-from-a-script/