ruby 来自https://stackoverflow.com/questions/22078627/how-do-i-render-a-partial-from-the-rails-console

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 来自https://stackoverflow.com/questions/22078627/how-do-i-render-a-partial-from-the-rails-console相关的知识,希望对你有一定的参考价值。

# initial setup
view_paths = Rails::Application::Configuration.new(Rails.root).paths["app/views"]
av_helper = ActionView::Base.new view_paths

# (Optional) include this if your partial uses route helpers:
include Rails.application.routes.url_helpers

av_helper.render "path/to/your/partial"

# Several options to use with render, for example render plain: | text: | html: | template: | partial: |

以上是关于ruby 来自https://stackoverflow.com/questions/22078627/how-do-i-render-a-partial-from-the-rails-console的主要内容,如果未能解决你的问题,请参考以下文章

ruby 优化和缩小您的GIT存储库(Ruby脚本)。来自Jeff Smith @ rallydev.com。

使用来自 GitLab 的私有 gem 构建一个 Ruby 项目

ruby 来自Denys的数字任务

在 Ruby 中解析来自 Eventbrite API 的 JSON 响应

ruby 来自https://stackoverflow.com/questions/2505067/class-self-idiom-in-ruby

ruby 来自http://culttt.com/2015/07/08/working-with-mixins-in-ruby/