Search Results

Search found 3 results on 1 pages for 'jvk'.

Page 1/1 | 1 

  • Mystery in Ruby sinatra

    - by JVK
    I have the following Sinatra code: post '/bucket' do # determine if this call is coming from filling out web form is_html = request.content_type.to_s.downcase.eql?('application/x-www-form-urlencoded') # If this is a curl call, then get the params differently unless is_html params = JSON.parse(request.env["rack.input"].read) end p params[:name] end If I call this using Curl, params has values, but when this is called via a web form, then params is nil and params[:name] has nothing. I spent several hours figuring out why it happens and asked help from other people, but no one could really find out what is going on. One thing to note is, if I comment out this line: params = JSON.parse(request.env["rack.input"].read) then params has the correct value for "web-form" posting. Actually, the goal is to get the params value if this code is being called by CURL call, so I used: params = JSON.parse(request.env["rack.input"].read) but it messed up the web-form posting. Can anyone solve this mystery?

    Read the article

  • Sinatra as backend (API) for Rails app or padrino or any hybrid solution?

    - by JVK
    Is it a good idea to build backend APIs in Sinatra for Rails app. Or is it better to use Padrino? I want to have my backend provides API as service, so that anytime, if I have to develop same app for any client, I can use that back-end API (web services). What is the best approach? My goal is to expose back-end as web services and even rails uses it for webapp. What are the disadvantages or advantage of different approaches?

    Read the article

  • jQuery center multiple dynamic images in different sized containers

    - by JVK Design
    So I've found similar questions but none that answer all the questions I have and I know there must be a simple jQuery answer to this. I've got multiple images that are being dynamically placed in their own containing div that have overflow:hidden, they need to fill their containing divs and be centered(horizontally and vertically) also. The containing divs will be different sizes as well. So in short: multiple different sized images fill and center in containing div. containing divs will be different sizes. will be used multiple times on a page. Hopefully this image helps explain what I'm after. Click here to view the image. HTML I'm using but can be changed <div class="imageHolder"> <div class="first SlideImage"> <img src="..." alt="..."/> </div> <div class="second SlideImage"> <img src="..." alt="..."/> </div> <div class="third SlideImage"> <img src="..." alt="..."/> </div> </div> And the CSS .imageHandler{ float:left; width:764px; height:70px; margin:1px 0px 0px; } .imageHolder .SlideImage{ float:left; position:relative; overflow:hidden; } .imageHolder .SlideImage img{ position:absolute; } .imageHolder .first.SlideImage{ width:381px; height:339px; margin-right:1px; } .imageHolder .second.SlideImage{margin-bottom:1px;} .imageHolder .second.SlideImage, .imageHolder .third.SlideImage { width: 382px; height: 169px; } Ask me anything if this doesn't make sense, thanks in advance

    Read the article

1