Data dodania Pytanie
2017-12-09 04:12 Kaminari pager not working with Sinatra and Mongoid? »
Can't get Kaminari to work with Sinatra and Mongoid. I'm getting this error: NoMethodError at /api/events undefined method `page' for #<Mongoid::...
(0) odpowiedzi
2017-12-08 21:12 Sinatra - values disappearing between route and view »
I am using jquery / ajax to pass into a route two variables (from a slider), min and max. At this point I just want the values and while I can see th...
(0) odpowiedzi
2017-12-07 23:12 How do I share Redis key/values across multiple instances with rackup/Sinatra? »
I'm trying to use Redis as my session store, which seem to work just fine. However I can't figure out how to let multiple instances of Sinatra access ...
(0) odpowiedzi
2017-12-07 07:12 How to use Ruby Sinatra + ActiveRecord to read .sql file and extract the content? »
I'm familiar with Sinatra but I am completely new to ActiveRecord and Database stuff, I'm trying to use ActiveRecord from a .sql file full of data wit...
(0) odpowiedzi
2017-12-06 20:12 how do i save large amount of data into DB using DataMapper »
Im trying to insert into the database but sinatra throws this error DataObjects::ConnectionError at / database is locked at line Name.create(babyna...
(0) odpowiedzi
2017-12-06 16:12 Oj gem: incompatible library version »
I'm trying to start up an application in localhost made it with Sinatra and after running bundle install I got the following error: /home/diego/.r...
(1) odpowiedzi
2017-12-04 11:12 selecting one check box per row »
I want the user to only select one student per row I have this for loop to dynamically create rows in a table: for(let i = 0; i<<%=Voter.websi...
(0) odpowiedzi
2017-12-03 21:12 display page in iframe »
post '/uploadZIP' do zipFile = params['zip'][:filename] if zipFile.end_with? '.zip' File.open(params['zip'][:filename], 'w') do |f| f.write(para...
(0) odpowiedzi
2017-12-03 06:12 open zip file using rubyzip »
def extract_zip(file, destination) FileUtils.mkdir_p(destination) Zip::ZipFile.open(file) do |zip_file| zip_file.each do |f| file_path = File....
(0) odpowiedzi
2017-12-02 22:12 How to display websites in iframe »
I am using ruby and sinatra. I need to create a website that allows the user to upload a zipfile of other websites and display all of them in multiple...
(0) odpowiedzi
2017-12-02 02:12 How to keep a Sinatra cookie value as an integer »
I set the cookie using an integer cookies[:which_link] ||= 0 It seems to convert it from an integer to a string, because there are no complaints. ...
(1) odpowiedzi
2017-12-01 21:12 Ruby Savon - Parse XML string »
I have exhausted google on this subject and I just can't seem to get it right.. I have the following XML payload returned from Savon: <?xml ver...
(1) odpowiedzi
2017-12-01 03:12 Post Request from client With Proper Headers Always return 401- UnAuthorized »
Am a newbie to ruby. I am trying to invoke a REST API from ruby code. I have tried the code with both as standalone ruby code and inside a application...
(0) odpowiedzi
2017-11-30 15:11 How to save item in DataMapper database in to a CSV and download it to the browser using Ruby/Sinatra? »
I am currently using Ruby and Sinatra. I have a DataMapper DataBase. When the user clicks a button asking for a report of the DB contents, I want to...
(0) odpowiedzi
2017-11-30 09:11 Parsing JSON ruby in XML »
Script iterate through table "orders", but problem with row 'cart': there are JSON arrays in DB. orders = 10 doc = Nokogiri::XML::Builder.ne...
(0) odpowiedzi
2017-11-29 04:11 ActiveRecord 'where not' and 'where' in same query »
I would like to build a 'waiting_on' list where the users in the list meet two conditions: they do not belong to the current auction (User.where.not(a...
(1) odpowiedzi
2017-11-28 20:11 Add usernames to database »
I have this line in an .erb file to get the input of the username <input type="text" placeholder="User Name" name="user[username]" value="<%#{@...
(0) odpowiedzi
2017-11-27 21:11 Supporting Multiple Cookie Domains with Rack::Session:Cookie and Sinatra »
We have a customer that we support on a subdomain of our mains site like this: them.us.com What they want is something.them.com We're using Rack...
(0) odpowiedzi
2017-11-27 03:11 Sprockets Assets not compiled when visiting with Sinatra »
The issue I'm having is that the generated asset path does not point to anything -- my project directory doesn't change / sprockets doesn't build / co...
(1) odpowiedzi
2017-11-24 19:11 Using Ruby and Sinatra, Is it possible to use HAML in an "internal" or "inline" manner? »
I've done gem install sinatra and gem install haml And I have this .rb file require 'sinatra' get '/abc2' do "<b>aaaaaaaaaaaaa</b>" en...
(2) odpowiedzi
2017-11-23 23:11 Query array in sinatra with mongodb »
I'm trying to show my data with a filter in Sinatra from my mongodb. One of the parameters is an array, and it's not working. I read that to query an ...
(1) odpowiedzi
2017-11-23 13:11 ActiveRecord has_many :through doesn't assign value through »
I am working with a song, genre and artist model. The classes look like below: class Genre < ActiveRecord::Base has_many :song_genres has_...
(1) odpowiedzi
2017-11-23 13:11 Sinatra: pass nested routes to controllers »
What I try to achieve with Sinatra is, I think fairly simple issue. I have a bunch of controllers (coming from the Rails world) and I run them from my...
(1) odpowiedzi
2017-11-22 15:11 Clearing cache in rspec of Sinatra app »
I would like to clear the cache in the middle of one of my specs. Is there an easy way of this being done? Thanks ...
(0) odpowiedzi
2017-11-21 16:11 Sinatra error -- JSON::ParserError - 784: unexpected token »
I have an api in Sinatra (Mongodb). I am trying to write some data with the POST method from very small application written in Angularjs. data I am tr...
(2) odpowiedzi
2017-11-21 04:11 Session gets lost randomly on ruby app with passenger + nginx setup »
We have a sinatra app which is running on passenger + nginx setup, Currently we are facing an issue that Session gets lost randomly. We also tried dis...
(1) odpowiedzi
2017-11-21 04:11 Ruby Sinatra Hash nested in Array »
I am a bit of ruby nooby and can't seem to grasp, what appears to be a hash nested in array?! if I run the following: widgets = Sinatra::Application...
(1) odpowiedzi
2017-11-20 22:11 How to process html form data with kemal and crystal »
I want to get user input in an html form and use the data to populate a database table. Sinatra returns the form data in a hash, params. Can I do this...
(1) odpowiedzi
2017-11-20 22:11 Sinatra - ActiveRecord::ConnectionNotEstablished: No connection pool for ActiveRecord::Base »
I've only been able to find rails answers to this question. Whenever I run rake db:migrate I am getting the aforementioned error. As far as I am aware...
(0) odpowiedzi
2017-11-20 11:11 Testing with Postman keeps returning Invalid JSON error »
I have created REST Api in Ruby on Sinatra platform. I am testing the service with Postman and whatever JSON form I try to POST I keep getting an erro...
(0) odpowiedzi
2017-11-19 21:11 Can I create global variables that work accross routes in Sinatra (Ruby)? »
I'm trying to make a ruby class manage most of what's going on in my application, and I intend to manage its params through the erb with embeded Ruby ...
(1) odpowiedzi
2017-11-18 15:11 How to output phrase n times in sinatra »
How can I do the equivalent of the below code in sinatra? - Output a phrase to a webpage n times? get "/say/:number/:phrase" do params[:number].to...
(1) odpowiedzi
2017-11-12 04:11 How to print to web page using Ruby and Sinatra »
I'm calling a ruby function in a post method and I'm trying to output the contents from the function to the web page but it prints the output in my co...
(1) odpowiedzi
2017-11-11 18:11 Run Ruby file from html form submit »
I have a Ruby program that reads a file and returns a certain output. I have to now create a web app of this program using Sinatra. I created a form w...
(1) odpowiedzi
2017-11-09 21:11 clio-api v2 Create Note Error »
I am using Clio API v2 and I can't seem to get my ruby app within Sinatra to create a new note properly. This is the part in my app.rb that is giving ...
(0) odpowiedzi