I am getting Encoding::UndefinedConversionError at /find/Wrocław
"\xC5" from ASCII-8BIT to UTF-8
For some mysterious reason sinatra is passing the string as ASCII instead of UTF-8 as it should.
I have found some kind of ugly workaround... I don't know why Rack assumes the encoding is ASCII-8BIT ... anyway, a way is to use string.forc...
I'm considering using Integrity as a continuous integration tool, but don't want to (or can't) set up a separate domain for the application.
Is it possible to get a Sinatra app (like integrity), and make it a Rails Engine? How would one go about do it?
EDIT: I realize that the "engines" normally require Rails code like controllers a...
Are there any similar frameworks like Sinatra, Ramaze etc in .NET?
I'm in theory after a framework that let's me create an entire webapp with just one classfile (conceptually) like Sinatra.
I'm going to use it for something work-internal, where ASP.NET MVC is too "big" (and I get confused by it's usage) and I have WebForms up to my ear...
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 get it running.
Thanks
...
I'm writing a smallish web service in Ruby using Sinatra. Access to pretty much everything is controlled using http basic auth (over https in production).
There is one particular directory that I want to exclude from requiring authorization. Is there an easy way to do this?
...
I'm new to all three, and I'm trying to write a simple contact form for a website. The code I have come up with is below, but I know there are some fundamental problems with it (due to my inexperience with sinatra). Any help at getting this working would be appreciated, I can't seem to figure out/find the documentation for this sort of...
When I define the User has_many meetings, it automatically creates a "user_id"
key/value pair to relate to the User collections. Except I can't run any
mongo_mapper finds using this value, without it returning nil or [].
Meeting.first(:user_id => "1234")
Meeting.all(:user_id => "1234")
Meeting.find(:user_id => "1234")
All return nil....
I'm looking to use render like so:
render :action => 'page#form'
I also tried this:
render :template => 'site/page#form'
That didn't work either. The form on this particular page is at the very bottom, and if any errors occur on submission I'd hate for the user to be defaulted to the top of the page. I also need to use render (not ...
Im confused about Sinatra (the ruby framework).
Is it a lightweight Rails replacement or you can have them running side by side?
Can you do a web application (as in Rails)? For example a twitter clone?
...
Im getting interested in Sinatra to develop micro web applications.
I'm not sure where to draw the line when choosing between Sinatra and Rails.
Please can you provide some real life examples of applications in Sinatra in the web?
...
Hi,
I programmed in Ruby and Rails for quite a long time, and then I fell in love with the simplicity of the Sinatra framework which allowed me to build one page web applications. Is there a web framework like Sinatra available for Erlang? I tried Erlyweb but it seems far too heavyweight
...
I would love to give my windows based desktop applications a web interface and vice versa. My desktop application is written in wxRuby and the webserver is Sinatra (using webrick). The simplest idea was just to mash them together, this does not work.
This code does not work. The webserver and gui app do not run simultaneously. The...
I'm trying to get this Sinatra GET request to work:
get '/:year/:month/:day/:slug' do
end
I know you can get one param to work with block parameters:
get '/:param' do |param|
"Here it is: #{param}."
end
But how can I use multiple block parameters with the first code block? I'm open to other methods.
...
Hi guys,
Am having trouble getting enable :sessions to persist for a simple Sinatra app hosted on passenger/apache. I'm storing the state of session[:authorized] in a cookie. It works locally when hosted on Rack::Handler::Mongrel but I can't seem to get same behaviour on passenger.
I've tried two methods for enabling sessions, both of ...
Hi all,
I'm very new to web programming (or actually, very old to it, since the last time I messed with the web was HTML 1.1), but now need to deploy a web application quickly. It seems like every time I turn around, there's new acronyms and technologies to learn (JSON, XMLRPC, GWT, Javascript, Rails, etc).
Here's what my app must do:...
I have a small Sinatra app I'm running on a shared hosting account using Passenger. However, the first time the app is accessed after a while, I get a Passenger error page saying the application could not be started. Usually because Sinatra could not be found.
I am assuming this is just a normal delay from when a new instance is spawned...
I have an application that I am using Active Record to access a database. I'm trying to take the information and put it into a hash for later use.
Here is basically what I am doing.
require 'active_support'
@emailhash = Hash.new
emails = Email.find(:all)
emails.each do |email|
email.attributes.keys.each do |@co...
I have a small Sinatra app which generates html fragments for me from an ERB template.
How do I html_escape the output?
The <%=h somestring %> helper does not exist in Sinatra.
...
I have the following small Sinatra application (I've removed the extra unneeded code):
helpers do
def flash(args={})
session[:flash] = args
end
def flash_now(args={})
@flash = args
end
end
before do
@flash = session[:flash] || {}
session[:flash] = nil
end
post '/post' do
client = Twitte...
Hi,
I have an array of strings, called @theModels, in a routine implemented as part of a Sinatra server. These models are options for the user to select, and are obtained by the back end (the idea being, as new models are added, then the front end code should not change).
I'm using haml to render html.
How can I enumerate each eleme...