Giter VIP home page Giter VIP logo

plok's Introduction

Plok

Backend sidebar navigation component

A plok:sidebar generator was added that'll copy over the necessary markup files for a mobile-friendly sidebar component in your backend:

bin/rails g plok:sidebar

Note that it will only copy markup files so as to guarantee uniform functionality across our backends, especially in regards to the JS. Meanwhile, custom changes or additions to the CSS should be made in supplementary files.

Overriding models

You might want to add something to a Plok model at some point. As an example, let's override Log.

First, create a config/initializers/plok.rb file that contains the following:

Rails.configuration.to_prepare do
  require Rails.root.join('app/models/log.rb')
end

Then create the model file referenced above, and use class_eval to override it.

Log.class_eval do
  mount_uploader :file, LogFileUploader

  def foo
    'bar'
  end
end

You'll be able to add to the model without removing any of its features. You could also override any of its methods or scopes, if you know what you're doing.

plok's People

Contributors

davelens avatar bauffman avatar

Watchers

 avatar

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.