Skip to content

Simple URL-Helpers #1

@kostia

Description

@kostia

There should be a simple Helper for generating the URL for changing a Translation.

For example the additive way...

# app/helpers/application_helper.rb
require 'riddick/helpers'
module ApplicationHelper
  include Riddick::Helpers
end

# app/views/layouts/application.html.erb
<button><%= riddick_t '.button' %></button>

Or the destructive way...

# config/initializers/riddick_i18n.rb
require 'riddick/helpers'
I18n.extend Riddick::Helpers

# app/views/layouts/application.html.erb
<button><%= t '.button', riddick: true %></button>

Both ways should generate following:

<button>
  My Button Label
  <span data-riddick-url="/admin/riddick/my?k=en.layouts.application.button"></span>
</button>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions