Identifier your view from controller and action.
Ruby HTML JavaScript CSS
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
test
.gitignore
Gemfile
Gemfile.lock
MIT-LICENSE
README.md
Rakefile
view_id.gemspec

README.md

view_id

Identifier your view from controller and action.

Usage

Use view_id method your controller or view.

class PostsController < ApplicationController
  def index
    view_id #=> "post--index"
  end
end
class Admin::DeletedPostsController < AdminController
  def show
    view_id #=> "admin-deleted_posts--show"
  end
end

Installation

Add this line to your application's Gemfile:

gem 'view_id'

And then execute:

$ bundle

License

The gem is available as open source under the terms of the MIT License.