Data dodania Pytanie
2017-05-08 15:05 Running a ruby sinatra postgreSQL error »
I have been trying to run my ruby app that previously was run on my MACbook. Currently, I am using a Windows OS and bash. PostgreSQL is installed. So ...
(0) odpowiedzi
2017-05-05 22:05 Getting an error when try to do Heroku run rake db:migrate »
I am making small Sinatra app and trying to put it on Heroku server. when I do Heroku run rake db:migrate, Heroku is giving error "Gem::LoadError: Sp...
(1) odpowiedzi
2017-05-05 01:05 heroku deploy with Ruby & Sinatra: application error »
I'm trying to deploy to Heroku and can't get past this error message: "Application Error" An error occurred in the application and your page cou...
(0) odpowiedzi
2017-05-05 00:05 Re-use "controller" code in sinatra »
Like rails routes resources, I am looking to make a sinatra application share the same code between different routes. For example, in a company, we ...
(0) odpowiedzi
2017-05-04 05:05 navbar-right is not responding in bootstrap navigation »
I am trying to create a small Sinatra app. Currently, trying to set up a conditional navigation bar with the help of bootstrap. I am trying to use nav...
(1) odpowiedzi
2017-05-02 11:05 How can we render a random partial in a Slim template within a Sinatra application? »
Given a really simple Sinatra application: require 'sinatra' require 'slim/include' get '/' do @specifically = %W(milk bread cheese).sample slim...
(1) odpowiedzi
2017-04-28 21:04 Testing classic Sinatra application with Cucumber »
I am trying to test my Sinatra application with Cucumber and am having trouble. This question references testing a modular Sinatra application with c...
(0) odpowiedzi
2017-04-27 19:04 How to upload multiple files via Sinatra and avoid NoMethodError - undefined method `read' for "#<File:0x0000000xxxxxx0>":String »
I'm trying to upload the nth file from a multi-file array: post '/upload2' do puts params #pp params mx=params['images'].map{|f| f[:filename] }...
(2) odpowiedzi
2017-04-27 00:04 Return filtered records from a returned set of data from two tables »
I have three tables: - Venue - Space (belongs to Venue) - Included Space (belongs to Space) I receive the id of a Venue in the route and return all t...
(1) odpowiedzi
2017-04-26 11:04 Mysterious error deploying sinatra app to heroku: bundler: failed to load command: rackup »
I noticed that heroku is producing a mysterious error when I deploy my sinatra app. It works fine locally, and in fact, it runs fine on heroku as well...
(1) odpowiedzi
2017-04-20 19:04 Detect browser in Sinatra »
I need to know (on .rb/.haml level) if device is mobile or if browser is not supported. I don't want (or it won't work well for my need) to parse user...
(1) odpowiedzi
2017-04-19 22:04 How to return a JSON response from a before block »
I am writing a Sinatra-based API, and want to protect certain endpoints with an API key, validating the key before the route is processed. I understa...
(2) odpowiedzi
2017-04-19 08:04 How used consoled log to ajax param? »
Im trying to use this console log $.post("greeting", { salutation: console.log(5 + 6), name: "Friend" }, to ajax param salutation but not works H...
(1) odpowiedzi
2017-04-19 01:04 How to add data to returned ActiveRecord query records »
I'm doing a simple query to a database table to send off to an external service, but I need to add an element to each of the returned records before I...
(1) odpowiedzi
2017-04-18 17:04 Sinatra event triggered by Rufus Scheduler »
Trying to send an event from within Rufus Schedulers results in this error: { 70231586340180 rufus-scheduler intercepted an error: 70231586340180 ...
(1) odpowiedzi
2017-04-17 12:04 How to output variable in sinatra without <%= »
In Rails, there exist such helper as "concat" to output variables inside <% %> block for erb remplates. Which helper can I use in Sinatra to perfor...
(1) odpowiedzi
2017-04-15 01:04 Enabling HTTPS with Rack, Puma and Sinatra? »
I have a Ruby web application built with Sinatra, Rack and Puma. I'm using Sinatra to implement the controllers (MVC pattern), each handling a differe...
(0) odpowiedzi
2017-04-14 22:04 How to display data on the same page once a button is clicked [Sinatra/Ruby] »
I'm practicing making a web app in Sinatra and I'm trying update a page so that information from a database is displayed once a button is clicked (mor...
(1) odpowiedzi
2017-04-13 20:04 Changing the base URL for Capybara Acceptance Tests »
I am developing a sinatra based web application and I extensively use tests to make sure that everything is working before deployment. As testing fram...
(1) odpowiedzi
2017-04-12 01:04 How do we speed up transmission between client and server using websockets? »
Currently, I am using websockets to send an image to my server, process it, and then send it back. Specifically, I am using Ruby with Sinatra and sina...
(1) odpowiedzi
2017-04-11 19:04 Multiple file upload with ruby & sinatra »
I'm using the following code to upload a single file through a form: app.rb @filename = params[:file][:filename] file = params[:file][:tempfile] Fi...
(0) odpowiedzi
2017-04-11 05:04 How to read mixed POST types with sinatra »
I am having similar issue to this one In my case I am sending 'mixed' content using: ... $.ajax({ type: 'POST', url: '/create_product', ...
(0) odpowiedzi
2017-04-10 16:04 Sinatra and Postgresql -- how to use pure Sql, perhaps without ActiveRecord »
I have a quite simple Sinatra application for which I don't want to bother to create a model. I need to insert data into a Postgresql database without...
(1) odpowiedzi
2017-04-09 22:04 Ruby: class passes methods of running object »
I have a class where I create a new instance variable called @client which is an object in itself. Now, in another file I create an object from this c...
(1) odpowiedzi
2017-04-08 19:04 How to return json using mongoid »
I have a model: class Client include Mongoid::Document field :name, type: String field :age, type: Integer index({ name: 1 }, { unique: true ...
(1) odpowiedzi
2017-04-08 11:04 Why is an Array in my payload being flattened in Sinatra / Rack::Test? »
I'm trying to test a small Sinatra app using rspec. I want to pass a rather complex payload and am running into issues i do not understand: my payload...
(1) odpowiedzi
2017-04-06 21:04 Process the results of an HTTP request in the background - Ruby »
I wrote a quick (hah) server to accept a JSON payload that contains a URL to download an archive from. After parsing the JSON I download the file, unc...
(1) odpowiedzi
2017-04-06 15:04 best practice to run a sinatra app within docker »
I intend to create a microservice using sinatra and docker. I already know how to make eveything work in development: write sinatra app write docke...
(1) odpowiedzi
2017-04-06 13:04 Sorting elements in DataMapper »
I have a database, and I need to sort the whole table by the length, however I've got stack on it. require 'dm-core' require 'dm-migrations' require ...
(1) odpowiedzi
2017-04-04 23:04 What's the difference between defining helpers with "helper do" and in the main scope in Sinatra? »
When I define methods in Sinatra (classic mode) in the main scope and in the helpers do block, in both cases, the methods are available both in all ro...
(0) odpowiedzi
2017-04-04 23:04 HTTParty Patch Sinatra API returns "invalid value" »
The following route works as far as reaching out to the api. The api returns "invalid value". I'd assume this is a data type issue. API docs: val...
(1) odpowiedzi
2017-04-04 00:04 Can't POST results of ActiveRecord query via HTTParty »
I'm running a simple Sinatra app where I need to query some data and send a POST via JSON to a webhook URL for processing. I'm not sure how to properl...
(1) odpowiedzi
2017-04-03 18:04 Putting most accessed route first? »
I've read that Sinatra reads routes from top to bottom, meaning if a request matches 2 routes, the route defined first will be executed only, and the ...
(0) odpowiedzi
2017-04-03 06:04 Sinatra scope nomethoderror »
I am trying to making Sinatra application. But now I have a bug I can't solved. So I want help. When I entered /tasks?status=done, the application a...
(1) odpowiedzi
2017-03-30 19:03 Sinatra - how to match production urls with the app's urls »
Consider the following simple Sinatra application: require 'sinatra' post '/user/login' do # login logic... end When deploying the application to...
(0) odpowiedzi