Questions tagged [Sinatra] (37)

0
answer

The underlying code in Sinatra?

Can you please explain each line of this code in Sinatra: require 'sinatra' get '/' do 'Hello world!' end
Thurman.Lehner asked April 18th 20 at 12:13
0
answer

An example of a large site on Sinatra and the stack of used technologies?

An example of any large site written in Sinatra framework and a stack of used technologies
Vivianne asked April 18th 20 at 12:12
4
answers

Web application in Ruby. Where to start?

Then decided to port one of the PHP app to Ruby. Not so much with the goal to port for practical use, how to obtain experience. First started doing as a CGI app, debugging in the console. Then I wanted to see in the browser, I saw, I wanted to test the speed — I was horrified. Decided to look for options. Here's what I foun...
Marshall.Lakin74 asked October 10th 19 at 09:17
2
answers

Custom routes in Sinatra (Padrino)?

Welcome! Actively exploring freimark ruby — sinatra with padrino. The task is to organize urlgeneration, which is often used on contenty sites:site.ru/category/article-slug.html in yii similar solved using your own routing rules www.yiiframework.ru/doc/guide/ru/topics.url is there a similar opportunity for sinatra? I unders...
brain.Blo asked October 3rd 19 at 04:47
1
answer

Ruby, Sinatra select for a particular setting

A standard blog's code in Sinatra:post '/articles' do article = Article.new(params[:article]) if article.save redirect '/articles' else redirect '/articles/new' end end In the form are, respectively: id, title, content. In this code, to immediately apply the UpCase parameter to the title, so the result went to the base...
alec76 asked October 1st 19 at 03:11
1
answer

As for Sinatra to select a CSS depending of the domain?

Working on a project which will have several different faces, but DB and controller one. Actually had a question announced in the title. Thank you in advance.
Viola.Gulgows asked September 30th 19 at 18:07
0
answer

How to run Ruby app on localhost with Apache and mod_passenger 2 in OS X?

Please forgive me for the stupid question, didn't find any information on the issue. When I'm ready to run a Sinatra application on the local machine, I just enter in terminal ruby app.rb all works great without config.ru. When you deploy to your server, where to start I just service apache2 restart and there mod_passenger ...
Viola.Gulgows asked September 30th 19 at 15:00
1
answer

How to pass values of input s in the Array field in MongoDB Sinatra with Mongoid?

In the vyuha, there is such code:%form{"method" => "post", "action" => "/order"} %input{"name" => "firstname"} %input{"name" => "order", "value" => "burger", "type" => "checkbox"} %input{"name" => "order", "value" => "nuggets", "type" => "checkbox"} %input{"name" => "order", "value" => "...
Viola.Gulgows asked September 27th 19 at 20:40
2
answers

How to implement sms-confirmation of registration?

The site is built on Sintra and in action is this code:post '/registration/sms/:number' do code = Random.rand(1111..9999).to_s phone = params[:phone].to_s HTTParty.get('http://sms.ru/sms/send?api_id=' + api_id +'&to=' + phone + '&text=' + code) # check code end And this view:%form{:method => "post"} %div.form...
Viola.Gulgows asked September 27th 19 at 17:56
1
answer

How to download multiple files with one request to CarrierWave/Sinatra?

I'm not the first who asked, but not the last. How to download multiple files in CarrierWave and Sinatra? I have this action:post '/create' do params.delete 'submit' d = Dcmnt.new( :published => params[:published], :name => params[:name], :description => params[:description], :created_at => Time.now ) d.a...
Viola.Gulgows asked September 27th 19 at 17:09