Questions tagged [voltrb]

Volt is a Ruby web framework where your ruby code runs on both the server and the client (via opal). The DOM automatically updates as the user interacts with the page. Page state can be stored in the URL. If the user hits a URL directly, the HTML will first be rendered on the server for faster load times and easier indexing by search engines.

Instead of syncing data between the client and server via HTTP, Volt uses a persistent connection between the client and server. When data is updated on one client, it is updated in the database and any other listening clients (with almost no setup code needed).

Pages HTML is written in a handlebars-like template language. Volt uses data flow/reactive programming to automatically and intelligently propagate changes to the DOM (or any other code wanting to know when a value updates). When something in the DOM changes, Volt intelligently updates only the nodes that need to be changed.

https://github.com/voltrb/volt

77 questions
2
votes
1 answer

How do I do a jQuery toggleClass in Volt?

I'm playing around with Volt and currently trying to do a simple toggleClass for a sidebar in my Volt app (with no luck). Here is a code sample. app/main/views/main.html <:Title> {{ view main_path, "title", {controller_group: 'main'}…
luc
  • 43
  • 6
1
vote
0 answers

The volt view never releases memory

A beginner volt question here :-). I’ve created a simple volt app which pulls random images from the file system - a slide show. The image data is retrieved in a server task (in addition to the file path, I want dimensions orientation etc, so I use…
John Shea
  • 19
  • 4
1
vote
0 answers

Reactive field using jquery plugins

I'm migrating an app from rails to volt which uses some jquery plugins. As example, one of them is http://ionden.com/a/plugins/ion.rangeSlider/en.html I'm using opal-jquery inside action_ready to call the plugin, and visually it works. However…
1
vote
1 answer

How to use Carrierwave with the Volt framework?

It is pretty straightforward to use Carrierwave with Rails but not so much with Volt. I would like to know if it is possible to use CW with Volt, and what is the best way to do it.
Allanon
  • 547
  • 4
  • 24
1
vote
1 answer

Getting access to a ModelController

I am trying to interface with the YouTube player API. This works fine. However, the API lets you define callbacks that are fired whenever, for instance, the video has finished playing. I would like to call a ModelController action at that time. How…
Ryan
  • 956
  • 7
  • 8
1
vote
1 answer

Code highlighting problems with prettify in VoltRb

I've been having some problems getting the JavaScript prettify library to work on a project in VoltRb. The problem is that the code highlighting seems to work only when an error occurs and the page is reloaded. I think that the problem has something…
GDP2
  • 1,948
  • 2
  • 22
  • 38
1
vote
0 answers

Uploading pictures using Rack::Cors not working

I am trying to upload some pictures from my controller to my bucket on an Amazon S3. I am using the ruby Volt framework. I need CORS in order to do this, so I am using rack-cors. I have declared it correctly in my initializers/boot.rb file. This…
user3579220
  • 187
  • 1
  • 2
  • 9
1
vote
1 answer

How to implement client-side javascript (jquery .animate) in Volt?

I'm having trouble grasping how to deal with front end events in volt, and hopefully this specific question could help enlighten me. I implemented the simple chat program from the webcast and wanted to build on it. Specifically I want the chat…
1
vote
1 answer

Use ruby classes in Volt Framework

I was wondering what the best way to include ruby classes in the Volt framework. I want to use the Socket Class to find the IP address of the visitor of the site. I want to use it in a controller, but putting: require 'socket' at the top of the…
user3579220
  • 187
  • 1
  • 2
  • 9
1
vote
1 answer

How to query for Time less than another Time object in Volt with volt-mongo?

I am working on a Volt app that needs to compare times. Using a model that looks like this: class Punchcard < Volt::Model field :punchtime end I can save instances of the model with a Time object for punchtime and see that they are persisted into…
MattH
  • 68
  • 2
  • 7
1
vote
1 answer

An empty string with File-IO in VoltRb

I'm trying to do some file-reading in VoltRb and embed the contents of those files in my views. I initially planned that I would read the files on the server-side (since the client-side doesn't support file-reading), and then pass the strings of…
GDP2
  • 1,948
  • 2
  • 22
  • 38
1
vote
1 answer

Volt: Equivalent of destroy_all?

I have a form with a "reset this collection" button. Looks kind of like this: In my controller, I do this: def reset_patients puts "destroying" store.patients.each{|p|…
Steve Ross
  • 4,134
  • 1
  • 28
  • 40
1
vote
1 answer

How to load a component file just once in VoltRb

I have a component file that I only want to load once in my Volt project. Loading more than once will cause problems, similarly to loading the OpalRb library more than once. To clarify, I am loading this component file in a view file, and it keeps…
GDP2
  • 1,948
  • 2
  • 22
  • 38
1
vote
2 answers

Create a new project with a specific version in VoltRb

When I run volt new foo, it creates a project with the 0.9.3 version. I want to be able to create a new project with the 0.9.4pre1 version, but I'm not sure how to do that. How do you configure Volt so that running volt new foo will create a project…
GDP2
  • 1,948
  • 2
  • 22
  • 38
1
vote
2 answers

How to access a page's URL in VoltRb

I'm trying to run some code on a controller in Volt, but only on certain pages. I've looked through the docs, but I'm not really sure how to get access to a given page's URL. Is there perhaps some hidden variable or something in the page model, like…
GDP2
  • 1,948
  • 2
  • 22
  • 38