Created
October 16, 2014 15:02
-
-
Save mumoshu/aae19afee1db4467e059 to your computer and use it in GitHub Desktop.
ActionView・Partial TemplatesをRails Consoleでテストする方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rails.application.routes.default_url_options = { :host => 'example.com' } | |
| view_paths = Rails.application.config.paths["app/views"] | |
| action_view = ActionView::Base.new(view_paths).tap do |av| | |
| action_view.class_eval do | |
| include ApplicationHelper | |
| include Rails.application.routes.url_helpers | |
| include JobOffersHelper | |
| end | |
| end; nil | |
| action_view.render partial: 'default/job_offer', locals: { job_offer: JobOffer.first } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment