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
1
vote
2 answers

Is it possible to prevent sinatra/padrino from logging a request?

I'm looking for a way to prevent logging of health-check requests to my application. I can see that these projects are using Rack::CommonLogger, but I haven't been able to find anything in the documentation on ignoring certain requests.
Jonathan
  • 1,241
  • 9
  • 16
1
vote
3 answers

Configure padrino logger for stage environment?

How can I enable padrino logger of other environment other than prod, dev or test. Like, for example, stage env? My padrino app on my stage env do not write at file log. I tried Padrino::Logger::Config[:stage][:stream] =…
cpereira
  • 155
  • 9
1
vote
2 answers

Rails and Padrino ActiveRecord ignores GROUP_CONCAT in .select

ActiveRecord in Rails 3 or Padrino is ignoring GROUP_CONCAT inside a .select. I'm trying to figure out why AcitveRecord is ignoring this query: Dvd.includes(:dvd_director, :dvd_producer). select(" GROUP_CONCAT(DISTINCT…
kakubei
  • 5,321
  • 4
  • 44
  • 66
1
vote
0 answers

howto parse nested json attributes with activeresource

i am trying to parse the following jsons response via activeresource in the padrino framework from a…
1
vote
2 answers

Creating data parser in Ruby

I need to create a data parser that will read in a couple CSVs (predefined format), parse, check for validity, and then, if all goes according to plan, commit the data to the database. Finally, report any errors that the validity checker didn't…
Jeff Erickson
  • 3,783
  • 8
  • 36
  • 43
1
vote
2 answers

Sinatra with Padrino or Rails for a web API?

I've been programming in Rails for about 7 months now. Mainly an app to aministrate a database, you know, clean up, update, delete, find orphaned entries etc. I have an API that talks to our desktop programs written in PHP. We now find ourselves…
kakubei
  • 5,321
  • 4
  • 44
  • 66
1
vote
3 answers

padrino: command not found

I successfully installed Padrino with sudo gem install padrino, but when I try and run padrino ..., I get -bash: padrino: command not found. Even sudo produces this result. Anyone else run into this problem? I looked in /usr/bin, but it is not…
Jeff Erickson
  • 3,783
  • 8
  • 36
  • 43
1
vote
4 answers

Why am I getting a command not found for Padrino?

EDIT: This seems to work on my CentOS machine but not my Ubuntu box. $ which gem /usr/bin/gem $ which padrino /usr/bin/padrino $ which padrino-gen /usr/bin/padrino-gen I started playing with Sinatra but when I started thinking about some…
Ramy
  • 20,541
  • 41
  • 103
  • 153
1
vote
1 answer

Padrino/Sinatra Rack-Test POST does not fill in params

I'm trying to use Rack-Test to issue a post request to my padrino app: post '/sms', "name" => "Bryan" My route looks like this: post :index do puts params.inspect puts rack_input.inspect end rack_input is a method I wrote to parse the raw rack…
zombor
  • 3,247
  • 17
  • 30
1
vote
2 answers

Constants in Padrino/Sinatra routes

In Sinatra/Padrino where is a sensible place to add constants for use inside routes? I'm using Padrino to mount multiple apps so I want the constants available to all apps. (All apps inherit from a base class.) I've used Sinatra.helpers to add…
stubotnik
  • 1,952
  • 2
  • 17
  • 31
1
vote
2 answers

How do you set the WEBRick options parameter in the run method with Padrino

I don't want to monkey patch Padrino. I still want to be able to use the command padrino start -d from the command line. I want to get SSL up and running within padrino. Within Sinatra I just do: Rack::Handler::WEBrick.run MyServer,…
Jesse Earle
  • 1,622
  • 1
  • 11
  • 13
1
vote
1 answer

Mongomapper Foreign Key?

I'm currently using Mongomapper within a Padrino project where I'm importing data from an external source. The main object (Application) has two associated document types, Activity and Notice. However, I'd like to specify the foreign key myself,…
Pezholio
  • 2,439
  • 5
  • 27
  • 41
1
vote
2 answers

How can I render an image with Padrino?

I need to create image files on-the-fly in my controller with RMagick and send them to browser. Looks like it's very simple, but I can't find a way. I've tried just simply render them, but it fails due to data is binary. I've also tried to use…
at8eqeq3
  • 165
  • 3
1
vote
1 answer

Paperclip not saving attachment on Padrino

I am building a site using padrino. I use paperclip for uploading logos to one of the models. The problem I am experiencing is that Paperclip does not save the attachment, but also does not throw any errors. I think that the parameters passed to the…
nethopp3r
  • 111
  • 4
1
vote
1 answer

Less not compiling automatically with pow

I'm building an application with Padrino, and I've decided to use less for the stylesheet, mostly to use twitter bootstrap. I am having some trouble getting less to automatically compile my less files when serving the app via pow. When I run padrino…
Pedro Vanzella
  • 1,235
  • 1
  • 8
  • 13