{"id":29392938,"url":"https://github.com/lcampanari/action_view_preview","last_synced_at":"2025-07-24T11:02:38.754Z","repository":{"id":37858262,"uuid":"356999119","full_name":"lcampanari/action_view_preview","owner":"lcampanari","description":"Development tool for rendering views that wouldn't otherwise be rendered in your application","archived":false,"fork":false,"pushed_at":"2022-09-16T20:35:36.000Z","size":86,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-25T18:54:44.121Z","etag":null,"topics":["hacktoberfest","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lcampanari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-11T23:02:57.000Z","updated_at":"2021-10-09T02:38:21.000Z","dependencies_parsed_at":"2022-08-18T05:00:30.165Z","dependency_job_id":null,"html_url":"https://github.com/lcampanari/action_view_preview","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lcampanari/action_view_preview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcampanari%2Faction_view_preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcampanari%2Faction_view_preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcampanari%2Faction_view_preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcampanari%2Faction_view_preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lcampanari","download_url":"https://codeload.github.com/lcampanari/action_view_preview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcampanari%2Faction_view_preview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264473876,"owners_count":23613958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","rails","ruby"],"created_at":"2025-07-10T10:02:30.334Z","updated_at":"2025-07-10T10:06:22.922Z","avatar_url":"https://github.com/lcampanari.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActionViewPreview\nSometimes being able to preview a view might come in handy, like when a view is going to be used only inside a PDF, for example.\n\nThis gem allows a setup similar `ActionMailer::Preview`, and provides a development tool for rendering and debugging views that wouldn't otherwise be rendered in your application.\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'action_view_preview'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n```bash\n$ gem install action_view_preview\n```\n\n## Usage\n### Command Line Install\n\nRun `rails generate action_view_preview:install` and the generator should create a `hello_preview.rb` and mount the route in your `routes.rb` file, similar to the steps shown below in the manual install.\n\n### Manual Install\n1. Mount the engine in your `routes.rb`:\n\n```ruby\nRails.application.routes.draw do\n  # Add the line below\n  mount ActionViewPreview::Engine =\u003e \"/action_view_preview\"\nend\n```\n\n2. Create files `*_preview.rb` on `test/views/previews/`, e.g. `hello_preview.rb`:\n\n```ruby\nclass HelloViewPreview \u003c ActionViewPreview::Base\n  def hello\n    '\u003cb\u003eHello world\u003c/b\u003e'\n  end\nend\n```\n\n3. Access the route `/action_view_preview` to see the available previews\n\n## Configuration\n\nUse `config.action_view_preview` on `config/application.rb` to add custom configuration. For example, if you want to place the preview files in `lib/view_previews`: \n\n```ruby\nconfig.action_view_preview.preview_path = \"#{Rails.root}/lib/view_previews\"\n```\n\nPossible config values:\n\n| Config | Default | Description |\n| - | - | - |\n| `preview_path` | `test/views/previews` | Path to the preview files |\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcampanari%2Faction_view_preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcampanari%2Faction_view_preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcampanari%2Faction_view_preview/lists"}