epictetus / leapfrog Goto Github PK
View Code? Open in Web Editor NEWThis project forked from kobayashi-tbn/leapfrog
License: MIT License
This project forked from kobayashi-tbn/leapfrog
License: MIT License
= Leapfrog Leapfrog has mainly 2 functions. One is Migration support. Other is data registration support. Typically, an enterprise system records the user who submitted the data. But tables do not have created_by/updated_by columns on scaffold generate. By you are appending one line into a migration file, then created_by and updated_by columns are added. == Installation Download and copy to vender/plugins folder. or script/plugin install git://kobayashi-tbn.github.com/leapfrog.git == Example Migration Add 't.users' to Migration file into self.up method. class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name t.string :password t.string :email t.timestamps t.users # add column 'created_by' and 'updated_by' end end def self.down drop_table :users end end If you want to add column after created tables, Then run script/generate migration add_users_to_todo and edit the migration file.(ex. Model name is Todo.) class AddUsersToTodo < ActiveRecord::Migration def self.up add_users :todos end def self.down remove_users :todos end end == Controller ActionController includes Leapfrog::Controller::Users and each Controller object was extended Leapfrog::Controller::LfMacro for get the user_id from Leapfrog::UserInfo == Model ActiveRecord::Base includes Leapfrog::Model::Observe. and each Model object was extended Leapfrog::Model::LfMacro for set data to 'created_by' and 'updated_by' column of the Model. You need to define 'leapfrog_user_id' in each Model === Example class Todo < ActiveRecord::Base leapfrog_user_id end == How to get the User ID Leapfrog get user_id from the session in the Controller, so you have to set the user_id into session[:user_id]. == TODO I want to be able to use user_name as well as user_id by session[:user_name] == NOTE If it is running on development enviroment edit config/enviroments/development.rb config.cache_classes = true # false(default) -> true Copyright (c) 2011 Toshinobu Kobayashi, released under the MIT license
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.