0.01
No commit activity in last 3 years
No release in over 3 years
Helpful components for developing UI in Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 1.4.0
 Project Readme

RailsUiKit

Code Climate

Tool for developing markup (UI) in Rails.

Inspired by Cameron Daigle (Hashrocket) series of posts:

What included in the gem:

  • controller for browsing list of UI templates
  • helpers for creating sample data in the UI templates (read more about using in the above links)

This gem is compatible with Rails 3 and 4.

Installation and configuration

Add the next line to your application's Gemfile:

gem 'rails_ui_kit', group: :development

Note: If you want to use gem functionality on staging or production environment, don't forget to restrict access for /ui resource if it necessary.

And then execute:

$ bundle

Mount engine routes in application config/routes.rb:

Rails.application.routes.draw do
  mount RailsUiKit::Engine => '/', as: 'rails_ui_kit'
end

Create your own layout in app/views/layouts (e.g. ui.html.erb) and define ui_layout method in your ApplicationController:

class ApplicationController < ActionController::Base
  protected

  def ui_layout
    'ui'
  end
end

Usage

Create UI templates in application app/views/ui/ folder. Browse /ui/ path within app url in the browser to view the list of UI templates (partials and folders will be ignored).

Current UI helpers

Override / add functionality

Just create file in config/initializers/, e.g.:

# config/initializers/ui_helper_override.rb
module UiHelper
  def lorem_awesome
    'woot'
  end
end

Contributing

  1. Fork it ( http://github.com/puffy/rails_ui_kit/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request