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
1
vote
1 answer

Appending an element to a page in VoltRb

I'm trying to append an element to one of my pages in a Volt project, via opal-browser, like so: if RUBY_PLATFORM == 'opal' require 'browser' $document.body << my_dom_element.to_n end # controller code below Unfortunately, I'm getting an…
GDP2
  • 1,948
  • 2
  • 22
  • 38
1
vote
1 answer

Volt Framework integration test with Phantom not populating page with objects in store

I'm having a page show a list of objects (for example, some todos in a todo list), and the list does not successfully get populated in integration tests with phantom. Feature works in a regular browser, and I can verify I'm successfully populating…
neurodynamic
  • 4,294
  • 3
  • 28
  • 39
1
vote
1 answer

What does the exception "ArgumentError: a promise has already been chained" mean, and how do I debug it?

I'm going a little nuts working with Volt at the moment. The moment I try to do something a bit more complicated I end up getting the exception "ArgumentError: a promise has already been chained" in the browser console. The stack trace doesn't point…
Paul Leader
  • 1,015
  • 6
  • 9
1
vote
1 answer

How to flag a Volt user with is admin role?

How do I flag a specific user of a Volt with an admin role? I know I have to set if a current_user is admin role? on a model...but how does the database know you are the one with admin role?
cmcoto
  • 21
  • 1
1
vote
2 answers

Destroy an object in a Volt store collection

I'm trying to delete an object in a store collection using: store.widgets.where(code: 'xyz').first.destroy and get the following result from the promise: [:@action, :@realized, :@exception, :@value, :@error, :@delayed, :@prev, :@next] and the…
balmoral
  • 21
  • 1
  • 3
1
vote
1 answer

How do i implement a live clock?

I have been playing round with Volt for few days and love the simple bindings it allows. I was trying to show a 'live clock' on the page by using Time.now. I have tried binding Time.now to the various collections from within the controller but it…
1
vote
1 answer

Requiring files in the Volt Framework

I have a mixin I want to include in a few different classes in a Volt app. Pertinent structure as follows: Including file path: app/component_1/models/my_model.rb Included file path: app/component_2/mixins/my_mixin.rb Here's what I've tried: require…
neurodynamic
  • 4,294
  • 3
  • 28
  • 39
1
vote
1 answer

How to remove bootstrap in Volt, the new ruby framework

I'm getting this error while trying to launch the server. /home/action/.gem/ruby/2.1.1/gems/volt-0.8.26/lib/volt/server/rack/asset_files.rb:38:in `component': Unable to find component 'bootstrap', make sure the gem is included in your Gemfile…
1
vote
1 answer

How to Post data to Volt app?

I've got a use case where I'd like to POST some data to my Volt app, but there doesn't seem to be an obvious way to do it. app/main/config/routes.rb doesn't recognize a post method like a Sinatra route. I also tried a Volt-external class tied into…
B Seven
  • 44,484
  • 66
  • 240
  • 385
0
votes
1 answer

how to add validation messages in volt?

The volt docs refer to "client side validation" but there is no example code for this. I have volt-fields set up with a validation like this: validate :description, length: { minimum: 1, maximum: 1000 } then in my controller: buffer.save!.then do…
max pleaner
  • 26,189
  • 9
  • 66
  • 118
0
votes
1 answer

Voltrb: Unable to save attribute through checkbox

I'm trying out a tutorial for Volt, a ruby web framework, which I had some issue. When I try to bind the checkbox with a todo model, and when I clicked it, I got the following…
Gavin Yap
  • 642
  • 12
  • 26
0
votes
2 answers

Has Anyone Used Chronic or ChronicDuration in VoltRB?

I've put the chronic and chronic_duration gems in my Gemfile, and everything works fine in volt console. However, if I try anything on the client side, I get a name error. I tried requiring them in a client-side initializer, but that didn't…
Steve Ross
  • 4,134
  • 1
  • 28
  • 40
0
votes
1 answer

Current volt master generated project listens on localhost instead of broadcast

New project made with volt new with volt from master: can't connect to the server from the host os (running volt in a VM) it says: Listening on localhost:3000, but a new project in 0.9.6 says: Listening on 0.0.0.0:3000, I think it's related to…
0
votes
2 answers

Deploying VoltRb app on Heroku with persistence from MongoLab

I'm trying to get a new/blank volt (0.9.5) app into production on Heroku following the instructions on the Volt docs page. The application deploys successfully until I try and add the Mongo database. The below creates a new MongoLab database and…
Luke Cassar
  • 11
  • 1
  • 3
0
votes
1 answer

Volt Framework Routing: When Are Actions Invoked?

I have an app that will show collections of images according to routes like this: client '/{{_type}}', controller: 'main', action: 'index' client '/', {} The idea is that in MainController#index I will be able to look at params._type and do a query…
Steve Ross
  • 4,134
  • 1
  • 28
  • 40