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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
lanejs is a Ruby on Rails like MVC framework for javascript written in coffeescript. You can use it for SEO friendly pages.
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"
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
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"
Change your gemfile so it looks like:
ce 'https://rails-assets.org'
'rails-assets-lanejs'
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
To install the runtime dependencies and build the project just run grunt build
.
Tests are running with karma.js and are built with jasmine.
a start
[#1]
or [Closes #1]
if the commit resolves the issue.dist/
as they will surely cause merge conflicts later. Files under dist/
are only committed when a new build is released.