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
1 answer

Internal redirection in Padrino

Is there a way to internally redirect in Padrino? I am writing a RESTful service, no HTML response of browser client. I have a resource, lets say, xyz. MyApp.controllers :xyz I have two routes in a controller: put :index, :with => :xyz_id…
constantine1
  • 427
  • 1
  • 5
  • 12
1
vote
0 answers

How to bind multiple authentications to single user object with warden_omniauth

I'm trying to introduce social login with warden_omniauth into my project that is based on Padrino. I want to enable multiple authentications for one user, just like RailsCasts #236. But I found that warden will simply skip the authentication…
ghawkgu
  • 31
  • 1
  • 4
1
vote
1 answer

configuring heroku database connection in padrino - DATABASE_URL fails

I had a problem getting a padrino (0.11.2) application to run today on heroku. The errors I was getting back suggested that the connection URL wasnt working, e.g. 2013-06-20T12:55:59.040527+00:00 app[web.1]:…
Matt South
  • 131
  • 6
1
vote
1 answer

Padrino error launching sample_blog

I run into this error when I try to launch 'padrino sample_blog'. I installed updated versions of 'multi_json' and 'atomic' gems but I can't launch the blog and have no idea how to solve it, any help? :sample_blog user$ padrino start WARN:…
1
vote
0 answers

Implementing Remember Me in Padrino 0.11 with new admin interface

I'm trying to implement a 'Remember Me' feature in the new Padrino 0.11 Admin interface, but having a little bit of trouble due to the differences between it and Rails. Basically, I'm following along with…
Daryl
  • 23
  • 4
1
vote
1 answer

Start Padrino on different host (virtual)

I start WEBrick server through Padrino by this command: padrino start It listens on localhost, but I would like to use WEBrick virtual hosts to change this behaviour to respond to other hostnames like example.com. But padrino start doesn't have…
leemour
  • 11,414
  • 7
  • 36
  • 43
1
vote
0 answers

Why undefined method `email' for nil:NilClass in Sinatra/Padrino?

I'm following this tutorial http://www.padrinorb.com/guides/blog-tutorial and get a undefined method email for nil:NilClass error after assigning a user to all existing posts. Am I missing something? Possibly the tutorial is out of date with the…
cpursley
  • 182
  • 1
  • 7
  • 18
1
vote
1 answer

how do I extend LOAD_PATH for MiniTest?

[Aside: I am slowly answering my own question in "a concise recipe for installing, configuring and running minitest under autotest or Guard"] My environment: Ruby 2.0. Padrino 0.10.7. Minitest 2.6.2. RackTest 0.6.2. Short form: What is the best…
fearless_fool
  • 33,645
  • 23
  • 135
  • 217
1
vote
1 answer

how do you document padrino route methods using rdoc?

I'd like to use RDoc to document API calls in a web services app written in Padrino. Here's an example file: Analytics.controller :api do diable :layout ## # = /ping - test for response # The +ping+ command is a quick way to…
fearless_fool
  • 33,645
  • 23
  • 135
  • 217
1
vote
2 answers

success callback handler not called in jquery

I am working on a Padrino app running on my local server(localhost:3000). I am exposing a get call /location which is returning a json response. I am hitting this API from the javascript code written separately. Here is what i am…
1
vote
2 answers

replace value into select field into the admin panel

I created two models: Answers AnswersTypes {id, text} The latter one could accept two values {correct / wrong} as text. I modified the admin panel to accept an html select field to link an AnswerType directly within the Answer. Now the issue is that…
1
vote
1 answer

Sinatra / Padrino partials with modal window

I've searched exhaustively but can't find an answer for this. I'm writing a small app using padrino and I have 2 views, person and event. I have views and controllers for these and they are working fine. My issue is that from the 'event' view, I…
daesu
  • 612
  • 7
  • 10
1
vote
3 answers

How to mount a Sinatra app in a Padrino app?

Resque/Sidekiq come with a web frontend, which is a Sinatra app. The way to mount this in a Rails app is to add this to routes (http://railscasts.com/episodes/366-sidekiq?view=asciicast): mount Sidekiq::Web, at: "/sidekiq" How do i mount this in a…
Sathish
  • 20,660
  • 24
  • 63
  • 71
1
vote
2 answers

Specify complex password in Datamapper.setup

I m trying to use Datamapper as ORM for my Ruby/Padrino application. To setup db connection, in databse.rb, I have: when :development then DataMapper.setup(:default, "mysql://db_user:dsfsdfs@localhost/my_app_development") This work fine. But my…
constantine1
  • 427
  • 1
  • 5
  • 12
1
vote
1 answer

capybara matchers always eval to TRUE in rspec. Why?

Something strange is going on with capybara and rspec, which I'm setting up on Ruby 1.9.3, Padrino 0.10.7, rspec 2.11.0, capybara 2.0.2. A basic Padrino project set up haml and rspec (no custom code, yet!) other than just enough to load a "/" page…
Michael Lang
  • 1,028
  • 12
  • 21