Coder Social home page Coder Social logo

placements_teaser's Introduction

Placements Teaser

Installation

  • Install Rails: railsinstaller.org/

  • Clone repo:

    $ git clone [email protected]:shpen/placements_teaser.git
  • Install gems

    $ bundle install
  • Initialize database

    $ rake db:migrate
    $ rake db:seed
  • Start rails server

    $ rails s

Implementation

I used sqlite3, since it would be easiest to setup, avoiding the complexity of a Postgres service in our development environment. In production though, I would switch to Postgres and a different server gem such as Puma.

I added basic bootstrap styling to make the interface easier on the eyes, as well as adding support for editing on mobile. The experience is not best on mobile, considering the table is quite wide, but it works. More time could be spent on upgrading the mobile experience, but I believe it would be better just to develop a native app at that point.

The app functions basically as a one page app, with all interaction occuring through ajax calls. For a business that is building a consumer app, supporting users who disable or don’t support javascript would be preferred, but in this case I wanted to focus on the ideal javascript-enabled experience.

Below are the specific features I chose to implement:

  • Edit line-item adjustments.

  • See each item’s billable amount.

  • Flag individual line items as reviewed.

  • Flag campaigns as reviewed.

  • Sort by columns.

I grouped my development of these into three sections: sorting, adjustment editing, and flagging.

Sorting was fairly straightforward and only caused trouble when trying to sort by campaign, since that data was in a different table, so I had to create a special sort-case for that.

Adjustment editing went along with showing billable amount, since that would be updated when the adjustment was changed. I decided to create an extra column in the table for the billable amount, otherwise I would have to recalculate the total each time the data is shown. I could have done it on the fly, but the trade-offs there would really depend on production needs and whether space or speed was more of a concern.

Flagging also involved adding another column to both tables. I chose to keep the flags separate instead of applying a flag to each individual line item when the campaign was flagged, because otherwise the logic for determining if we should disable the campaign flag would be too complex. I also added a validation to prevent unflagging, in case someone tried to edit the source and submit ‘false’ for the reviewed flag.

placements_teaser's People

Contributors

shpen 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.