dawanda/lanejs

Name: lanejs

Owner: DaWanda Engineering Team

Description: LaneJS - A JavaScript Rails like Framework

Created: 2014-06-12 14:32:46.0

Updated: 2017-05-16 09:03:44.0

Pushed: 2017-03-10 14:40:35.0

Homepage: null

Size: 358

Language: CoffeeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

LaneJS

lanejs

Build Status

lanejs is a Ruby on Rails like MVC framework for javascript written in coffeescript. You can use it for SEO friendly pages.

Getting Started
Create a Model
space "DaWanda.Models.Message", ->

ass Message extends Lib.Model
@attrAccessible "subject", "text", "from", "to", "image_field", "hidden", "subject_type", "subject_id"
@validates "from", presence: true
@validates "subject", presence: true
@validates "text", presence: true
@validates "to", presence: true
@validates "image_field", format:
  with: /.*\.(jpg|jpeg|png|gif)$/i
  message: I18n.t("errors.messages.file_format_invalid")

# Use Crud to load and save data from JSON
@extend Lib.Crud
@resource "message"
@endpoint "/core/messages"
Create a Controller
space "DaWanda.Controllers.MessagesController", ->

ass MessagesController extends Lib.Controller

@beforeFilter '_doSomething'

index: ->
  @messages = [new DaWanda.Models.Message(from: "me", to: "you", subject: "i like you", text: "really <3")]

new: ->
  @message = new DaWanda.Models.Message()

edit: ->
  DaWanda.Models.Message.find(id: @params["id"]).done ( message ) =>
    @message = message

_doSomething: ->
  # TODO
Create Routes File
Router.draw ->

atch "/foo/:id", "foo#show"

Map a resource (will look for UsersController
and map index, show, new and update actions)
esources "users", ->
# You can add additional members/collection actions
@member "profile"
@collection "top_influencers"

You can nest resources too
esources "shops", ->
@resources "products"

Map a singular resource (will look for CartController
and map show, new and edit actions)
esource "cart"
Create a Stateful Widget
Integrate with rivets.js
Integrate with eco
Use with rails-assets.org

Change your gemfile so it looks like:

ce 'https://rails-assets.org'

'rails-assets-lanejs'
Building and Testing
Install Dependencies

For building and testing it is neccessary to install npm and run npm install --dev.

It is recommended to install the grunt-cli and karma-cli tool:

install -g grunt-cli
install -g karma-cli
Build Project

To install the runtime dependencies and build the project just run grunt build.

Run Tests

Tests are running with karma.js and are built with jasmine.

a start
Contributing
Bug Reporting
  1. Ensure the bug can be reproduced on the latest master.
  2. Open an issue on GitHub and include an isolated JSFiddle demonstration of the bug. The more information you provide, the easier it will be to validate and fix.
Pull Requests
  1. Fork the repository and create a topic branch.
  2. Be sure to associate commits to their corresponding issue using [#1] or [Closes #1] if the commit resolves the issue.
  3. Make sure not to commit any changes under dist/ as they will surely cause merge conflicts later. Files under dist/ are only committed when a new build is released.
  4. Include tests for your changes and make them pass.
  5. Push to your fork and submit a pull-request with an explanation and reference to the issue number(s).

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.