Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Isomorphic in RoR

    Hello,

    I'm following this guide trying to get Smartclient working in RoR:
    https://isomorphic.atlassian.net/wiki/display/Main/Integrating+with+Ruby+on+Rails

    I've followed all of the steps through step 3, but when I attempt to do 'rails s' and log into my server, I am shown Rails errors pertaining to this:

    couldn't find file './isomorphic/system/modules/ISC_Core'
    (in /<full_path>/app/assets/javascripts/application.js:9)

    Line nine is marked below.


    I have copied the entire isomorphic directory in my /public directory.
    I have the smartclient gem.

    My /app/asets/javascripts/application.js file looks like this:
    //= require jquery
    //= require jquery_ujs
    //= require ./isomorphic/system/modules/ISC_Core (THIS IS LINE 9)
    //= require ./isomorphic/system/modules/ISC_Foundation
    //= require ./isomorphic/system/modules/ISC_Containers
    //= require ./isomorphic/system/modules/ISC_Grids
    //= require ./isomorphic/system/modules/ISC_Forms
    //= require ./isomorphic/system/modules/ISC_DataBinding
    //= require ./isomorphic/skins/TreeFrog/load_skin
    //= require_tree .

    My /app/views/layout/application.html.erb looks like this:
    <!DOCTYPE html>
    <html>
    <head>
    <title><%= title() %></title>

    <%= stylesheet_link_tag "application", :media => "all" %>
    <script>var isomorphicDir = "./isomorphic/";</script>
    <%= javascript_include_tag "application" %>
    <%= csrf_meta_tags %>
    <%= render 'layouts/stylesheets' %>
    </head>
    <body>
    <%= yield %>
    </body>
    </html>

    I have also added the stanza listed in the tutorial to my /config/routes.db file after generating the smartclient controller.

    At this point I don't want to anything fancy; I just want to make one of the examples, such as the one below, appear on a page rendered by RoR. Thanks.

    isc.Canvas.create({
    ID: "cubeBin",
    top:40, width:400, height:300,
    showEdges: true
    })

    isc.IButton.create({
    title:"Create", icon:"pieces/16/cube_blue.png",
    mouseUp: function () {
    isc.Img.create({
    left: isc.Math.random(340),
    top: isc.Math.random(240),
    width:48, height:48,
    parentElement: cubeBin,
    src: "pieces/48/cube_blue.png",
    click: "this.destroy()"
    })
    }
    })

    #2
    It turns out that there were a few problems with the instructions on that wiki page. We've now updated the page to avoid some of those problems.

    It also appears that the smartclient gem that the page uses will need to be updated for Rails 4 -- the revised instructions should work with Rails 3, though.

    If you're using Rails 3, give the revised wiki page a try. Otherwise, you'll need to wait for the gem to be updated for Rails 4 (or try to do the needed updates yourself).

    Comment

    Working...
    X