Git Product home page Git Product logo

ck_fu's Introduction

CkFu
====

Where does the name ck_fu come from? It's a play on attachment_fu and I think curse words are funny.

This will put a bar across the top of your screen (except in production unless :if is specified and true) that shows the environment, 
databases, revision, etc. Why do we need something like this? because the development and staging sites often look identical to the 
production site. This makes it easy to tell the difference between the sites at a glance.

Example
=======

* Run rake ck_fu:copy_styles
* Add ck_fu.css to your list of stylesheets
* Add the following directly below your <body> tag
<%= ck_fu %>

More Advanced Usage
===================

* ck_fu (default) will not show up in production
<div class="test" id="ck_fu">Env: Test &sect; Current DB: myapp_dev</div>

* If RAILS_ROOT/REVISION exists (created by capistrano when deploying) (can suppress with :revision => false)
<div class="test" id="ck_fu">Env: Test &sect; Current DB: myapp_dev &sect; Revision: <rev></div>

* If RAILS_ROOT/DATE exists (can suppress with :date => false)
<div class="test" id="ck_fu">Env: Test &sect; Current DB: myapp_dev &sect; Deployed: <date></div>
To make this exist on the server, add something like the following to deploy.rb:
task :after_symlink, :roles => :web do
  run "date > #{current_release}/DATE"
end

* Arbitrary links
ck_fu(:links => [['Public site', root_path]])
<div class="test" id="ck_fu">Env: Test &sect; Current DB: myapp_dev &sect; <a href="/">Public site</a></div>

* Display based on some condition like the current_user is an admin
ck_fu(:if => current_user.try(:admin?)) - will display in production as well if the user is an admin.

For more information and screenshots, visit http://ck_fu.me

Copyright (c) 2008 umlatte LLC, released under the MIT license

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.