I have an ERB document: <!DOCTYPE html> <html> <head> <script> scrollDown = function() { document.body.scrollTop = document.body.scrollHeight; } </...
I am working on a project using Sinatra based framework called Dashing. Part of my project is to create a graph using RickShaw Graph. My problem is that I am not able to display month names and dates on the X-Axis. I am using coffeescript to render t...
I've been wanting to try out the Accordion effect on mootools but I can't get it to work, it's just like the js doesn't load at all this is the HTML code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http...
How to implement a page views counter in Sinatra and Ruby? I have tried the @@ variables but they reset to zero whenever the page is loaded... Like this one: http://148.251.142.233:8080/ Thanks!...
I would like to use Angular.js in my Sinatra applications. Unfortunately, I couldn't find any useful tips on this. I did find some Rails examples, however I have always found Rails and Padrino rather difficult to deal with, compared to the minima...
I would like to show on my page output from one of my sensor(moisture) connected to Arduino. Following script, gives me some value(number) every one second. require 'dino' board = Dino::Board.new(Dino::TxRx.new) sensor = Dino::Components::...
I am using inline haml templates in my sinatra app. I have a @@layout with a section like this: #message - if flash[:notice] %section.notice= flash[:notice] - if flash[:error] %section.error= flash[:error] When I use flash[:notice] =...
I'm using Haml as my templating language in a Sinatra-based web application, and I'm having trouble generating a JavaScript array based on information from a database model. Essentially, I'm trying to generate a JavaScript array made up o...
I am trying to embed the output of Ruby code in JavaScript: var stuff= "<% Representative.get('http://0.0.0.0:4568/') %>"; The embedded part is working by itself showing a result like this: { "name":"John Johnson...
I'm generally of the opinion that if it ain't broke don't fix it, but my current solution to this issue (though it does work) seems really ugly. I am using Ruby, Sinatra, Haml, and Highcharts, and I'd like to be able to pass data grab...
©2020 All rights reserved.