GithubHelp home page GithubHelp logo

kisskissbankbank / activeadmin-globalize3-inputs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mimimi/activeadmin-globalize3-inputs

0.0 10.0 0.0 5 KB

jQueryUI tab structure generation for globalized fields

License: MIT License

Ruby 100.00%

activeadmin-globalize3-inputs's Introduction

This small hack implements has_many friendly Globalize3 helper for ActiveAdmin.

Admittedly it generates structure that jQueryUI tabs() expect. However the whole idea is pretty simple and you should be able to change it to suit your needs.

Installation

Add this line to your application's Gemfile:

gem 'ActiveAdmin-Globalize3-inputs'

And then execute:

$ bundle

Usage by example

ActiveAdmin.register Gallery do
  form do |f|
    f.globalize_inputs :translations do |lf|
      lf.inputs do
        lf.input :title
        lf.input :description

        lf.input :locale, :as => :hidden
      end
    end

    f.has_many :photos do |photo|
      photo.inputs do
        photo.input :image, :as => :file
      end

      photo.globalize_inputs :translations do |lp|
        lp.inputs do
          lp.input :description

          lp.input :locale, :as => :hidden
        end
      end
    end

    f.buttons
  end
end

As you can see, there's no special option for locales. The list is taken from I18n.available_locales, so you'd probably want to define the locales your application works with somewhere.

Contributing

  1. Fork
  2. Invent better name
  3. Improve
  4. Enjoy

activeadmin-globalize3-inputs's People

Contributors

slotos avatar sunny avatar duosrx avatar

Watchers

 avatar Bastien Maillard avatar Florent DUVEAU avatar James Cloos avatar Agathe avatar Joachim avatar William Pollet avatar Camille Delbove avatar  avatar Morad IGMIR 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.