sinatra Questions
3
Solved
I'm building a simple app in ruby using the Sinatra framework. It's mainly "get" based - most requests will be for listing data. However there are a couple of key screens in the app that will colle...
9
I'm trying to build an rspec test that sends JSON (or XML) via POST. However, I can't seem to actually get it working:
json = {.... data ....}.to_json
post '/model1.json',json,{'CONTENT_TYPE'=&g...
8
Let's say an application has really specific data which belongs to a user, and nobody is supposed to see it except the owner. I use MySQL database with DataMapper ORM mapper. The application is wri...
Luehrmann asked 8/12, 2009 at 16:56
4
Solved
I'm trying to test for a redirect on the homepage in my sinatra app (more specifically, a padrino app), in rspec. I've found redirect_to, however it seems to be in rspec-rails only. How do you test...
4
I have no idea how to test my Sinatra application. Do I just run
ruby
That does not seem to work. All files out there only talk about how to write the contents of the file, but not about how to...
4
Solved
Is there a way to override the sinatra default NotFound error page ("Sinatra doesnt know this ditty")? I want sinatra to show only a plain string as "Method not found" when it does not found the pr...
19
this question is for Windows
I tried installing the gem 'sinatra-websocket', but when I ran gem install sinatra-websocket, I got this error...
ERROR: Failed to build gem native extension
... along ...
4
Solved
On server-side using Sinatra with a stream block.
get '/stream', :provides => 'text/event-stream' do
stream :keep_open do |out|
connections << out
out.callback { connections.delete(out...
3
I'm new to Ruby Sinatra, I tried to build a simple web application with Sinatra with the following code:
require 'rubygems'
require 'sinatra'
get '/firstapp' do
"Welcome to my first Sinatra ...
Overcritical asked 20/5, 2021 at 7:25
10
Solved
I have a Sinatra server that is returning multiple JSON objects from the database in a streaming manner. The objects would look like:
{"a": 1, "b": 2, "c": 3}
{"a": 4, "b": 5, "c": 6}
...
but th...
Digitiform asked 17/11, 2010 at 21:53
6
Solved
enable :sessions
set :session_secret, 'secret'
post '/login' do
session[:loggedInUser] = jsondata['username'].to_s
puts session[:loggedInUser] + " is the session"
end
Everything is good at thi...
5
Solved
In Sinatra, I'm unable to create global variables which are assigned values only once in the application lifetime. Am I missing something? My simplified code looks like this:
require 'rubygems' if...
Acevedo asked 24/12, 2010 at 9:43
2
Solved
I have a Sinatra app that I run as a daemon, using Apache port-forwarding to mediate between port 80 and port 7655. This has been working fine in the past. Today, not so well. I cannot figure out w...
Regalado asked 30/9, 2012 at 14:22
2
Solved
I am trying to write a Sinatra application that groups components together (sort of like controllers). So for the "blog" related things, I want an app called Blog mounted at /blog. All of the route...
6
Solved
As the title says, Google doesn't give anything useful concerning this.
How do I set up and configure HTTPS/SSL for Sinatra apps?
How do I create a HTTPS route?
I have never used HTTPS for my ap...
2
Solved
I am trying to connect my Sinatra app to PostgreSQL database with this tutorial: http://samuelstern.wordpress.com/2012/11/28/making-a-simple-database-driven-website-with-sinatra-and-heroku/. Everyt...
Eliezer asked 22/9, 2014 at 13:2
5
Solved
So, I want to have completely custom logging for my sinatra application, but I can't seem to disable the Rack::CommonLogger.
As per the sinatra docs all I should need to do is add the following l...
5
Solved
I am busy porting a very small web app from ASP.NET MVC 2 to Ruby/Sinatra.
In the MVC app, FormsAuthentication.SetAuthCookie was being used to set a persistent cookie when the users login was vali...
Evita asked 24/8, 2010 at 18:38
4
Solved
I'm getting this
OmniAuth::Strategies::OAuth2::CallbackError at /auth/google/callback
csrf_detected | CSRF detected
My code:
require 'sinatra'
require "sinatra/json"
require "sinatra/config_...
2
Solved
-----> Ruby/Rack app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.0.pre.2
Running: bundle install --without development:test --path vend...
4
Solved
I have a REST service that's reasonably complete and will be used with an iOS app. It's built using Ruby/Sinatra but I don't think that really matters here.
I'm using HTTP Basic Authentication ove...
Honeywell asked 20/1, 2012 at 19:17
3
Solved
I have a simple sinatra application that needs to generate a file (via an external process), send that file to the browser, and finally, delete the file from the filesystem. Something along these l...
2
I am working on a Sinatra Project and have set some variables in the session for later usage.
The scenario for which I need help for is that I want to access the session object in a middleware cla...
10
I've just made the switch from rvm to rbenv and I'm trying to use bundler for gem management. After running bundle install and trying to run a simple sinatra app (ruby app.rb), I get this:
Could n...
5
Solved
I have lot of helpers in my main Sinatra project_name.rb and I want to remove them to the external file, what is the best practice to do that ?
from ./preject_name.rb
helpers do
...#bunch of he...
Daryldaryle asked 2/8, 2011 at 18:16
1 Next >
© 2022 - 2025 — McMap. All rights reserved.