Questions tagged [padrino]

Padrino is a ruby framework built upon the excellent Sinatra Microframework. Sinatra is a DSL for quickly creating simple web applications in Ruby. Padrino was created to make it fun and easy to code more advanced web applications while still adhering to the spirit that makes Sinatra great!

Overview

Padrino is a Ruby framework built upon the excellent Sinatra microframework. This framework makes it as fun and easy as possible to code increasingly advanced web applications by expanding upon Sinatra while maintaining the spirit that made it great.

For more overview, please see the Wikipedia article.

Features

Here is a list of major functionality Padrino provides on top of Sinatra:

  • Agnostic: Full support for many popular testing, templating, mocking, and database libraries.
  • Generators: Create Padrino applications, models, controllers i.e: padrino g project.
  • Mountable: Unlike other ruby frameworks, principally designed for mounting multiple apps.
  • Routing: Full url named routes, named params, respond_to support, before/after filter support.
  • Tag Helpers: View helpers such as: tag, content_tag, input_tag.
  • Asset Helpers: View helpers such as: link_to, image_tag, javascript_include_tag.
  • Form Helpers: Builder support such as: form_tag, form_for, field_set_tag, text_field.
  • Text Helpers: Useful formatting like: relative_time_ago, js_escape_html, sanitize_html.
  • Mailer: Fast and simple delivery support for sending emails (akin to ActionMailer).
  • Admin: Builtin Admin interface (like Django).
  • Logging: Provide a unified logger that can interact with your ORM or any library.
  • Reloading: Automatically reloads server code during development.
  • Localization: Full support of I18n.

Note that as a user of Padrino, each of the major components can be pulled in separately to an existing Sinatra application or they can be used altogether for a comprehensive upgrade to Sinatra (a full-stack Padrino application).

To read more about registering certain Padrino functionality into your Sinatra application, check out the Standalone Usage in Sinatra guide.

378 questions
0
votes
1 answer

Get the source of the request in padrino

Is it possible to get the source of the request in padrino in a server to server communication.For example if there are two server server1 and server2 and if server1 send a request to server2, is it possible to know in server2 that the request came…
Zodiac gem
  • 55
  • 6
0
votes
1 answer

Not able to install padrino gem

I'm getting this error when I'm trying to install padrino/sinatra gem. $ gem install padrino ERROR: While executing gem ... (Gem::Package::FormatError) package metadata is missing in linecache19-0.5.13.gem RUBYGEMS VERSION: 2.4.6 RUBY…
Nikhil Patil
  • 457
  • 1
  • 7
  • 15
0
votes
1 answer

How to run a script in a padrino context by passing the script path to padrino

How to run a script in a padrino context by passing the script path to padrino? I see that similar feature is available in rails: Executing Ruby script in an Rails application The padrino website:…
radiantRazor
  • 477
  • 3
  • 13
0
votes
1 answer

Padrino not reloading custom load paths on changes

I added a custom directory to my Padrino application (0.12.4). I added it to the load paths and everything loaded fine. The issue is that Padrino is not reloading changes to the files in my custom path. boot.rb Padrino.before_load do …
Moemars
  • 4,692
  • 3
  • 27
  • 30
0
votes
1 answer

How do I render a static haml template in padrino?

I want to do essentially the same thing: How do I automatically generate static HTML from HAML with Sinatra or Padrino? This answer didn't quite go far enough for me. After I have caching setup, how would I send a particular haml file to the…
ironicaldiction
  • 1,200
  • 4
  • 12
  • 27
0
votes
1 answer

NoMethod Error "join" on JRuby Padrino application on Tomcat 8

This one is really confounding me. I have a web application, written in JRuby, and compiled with Warbler. When I try to host the Warbled file in Tomcat, I constantly get a 500 Internal Server Error for (NoMethodError) undefined method `join' for…
rp.kelly
  • 28
  • 7
0
votes
0 answers

Is userstamp valid with Padrino?

I am trying to integrate userstamp into one of my projects and have been following the usage guide from https://github.com/delynn/userstamp. I have added model_stamp to the appropriate class and I have added include UserStamp to my controller. …
0
votes
1 answer

Nested routes in Padrino

I want to group routes into hierarchies. To that end I have created a top level controller thus: MyApp.controllers :group do disable :layout get '/' do {'dummy' => 'value'}.as_json end end Now I want to create routes with :group as…
341008
  • 9,862
  • 11
  • 52
  • 84
0
votes
2 answers

Cucumber not using a route in test mode that I can use in development mode

In development mode, I can point my browser at http://arewesmallyet.dev/data and I see a json dump of all of my scraped data, indicating that the route mapping, and the data action in the application are doing their job. In…
Camden Narzt
  • 2,271
  • 1
  • 23
  • 42
0
votes
1 answer

Idiomatic REST API versioning in Padrino app

I am writing a Padrino app which will expose a few services via REST apis. I need to version the apis. I found this answer which explains how to version an api such that the version is embedded in the uri. I would rather put my version info in the…
341008
  • 9,862
  • 11
  • 52
  • 84
0
votes
1 answer

How can I inline json in ruby/rails?

I'd like to skip parsing some json returned by my DB when I just turn it back into json again immediately in the response from my padrino app. ie I have get :data, provides: :json do Record.order(:day).map do |r| {r.day.to_s =>…
Camden Narzt
  • 2,271
  • 1
  • 23
  • 42
0
votes
1 answer

Is This a Bug? Can't Specify form id using form_for in Padrino

I have this form_for tag: = form_for @food, :autocomplete => "off", :id => "food" do |f| This is the tag it generates:
How can I specify the html form id…
kristianp
  • 5,496
  • 37
  • 56
0
votes
1 answer

How to add stuff I associated to migrations?

I have a seemingly easy problem, but I have been unable to find a proper explanation (or I've just been too tired to see it). I have following migrations and models: class User < Sequel::Model one_to_many :orders end …
Krzysztof Piszko
  • 1,355
  • 3
  • 12
  • 17
0
votes
1 answer

Why is Padrino trying to use a template when rendering a json response?

I have adopted a padrino application [repo], and am looking to move all the data into a json returned ajax call. From googling around I've seen: Padrino model from json data http://www.padrinorb.com/guides/controllers#provides-formats So I created…
Camden Narzt
  • 2,271
  • 1
  • 23
  • 42
0
votes
1 answer

Setting up resque-pool over a padrino Rakefile throwing errors

I have setup a Padrino bus application using super-cool Resque for handling background process and ResqueBus for pub/sub of events. The ResqueBus setup creates a resque queue and a worker for it to work on. Everything upto here works fine. Now…
Deepak A
  • 322
  • 1
  • 3
  • 12