Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace render_anywhere gem with ActionController::Renderer to support Rails 6 #55

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
update README
  • Loading branch information
danielpuglisi committed Aug 16, 2019
commit ab02b2d32b3b1432f881b1e9c71fee9534baefca
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,21 @@ You can add optional interpolation modifiers using the `%{variable:modifiers}` s
- `h`: humanize (for instance, `user_name` becomes `User name`)
- `p`: format phone (for instance, `48111222333` becomes `+48 111 222 333`)

### URL Defaults

Textris uses `ActionController::Renderer` behind the scenes. Add or modify `config/initializers/application_controller_renderer.rb` in your Rails to change the default settings:

```
# Be sure to restart your server when you modify this file.

ActiveSupport::Reloader.to_prepare do
ApplicationController.renderer.defaults.merge!(
http_host: ENV['CANONICAL_HOST'], # or ActionMailer::Base.default_url_options[:host] to use the same host as ActionMailer
https: Rails.env.production?
)
end
```

## Example project

[Here](https://github.com/visualitypl/textris/tree/master/example/rails-4.2) you can find a simple example project that demonstrates **textris** usage with Rails 4.2. In order to see how it works or experiment with it, just go to project's directory and invoke:
Expand Down