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

From Padrino to Rails 3.2 - skinny controllers

I'm slightly lost in Rails 3.2. I've used to create skinny controllers in Padrino using methods like this: 15 post :task, :provides => :js do 16 result = execute(params) 17 render "home/task" 18 end Some methods does not exactly…
Ruy Rocha
  • 894
  • 8
  • 8
1
vote
1 answer

Using Padrino and DataMapper to access an existing Database

I'm migrating a sinatra app I have that acts as a backend UI for our DNS database. I've already got the DM configs in the sinatra app but want to migrate it to padrino so I can make it cleaner and easier to read, but also because I want to play…
Schroedinger
  • 1,273
  • 14
  • 32
1
vote
1 answer

Is there a usable rendering context in sinatra/padrino?

I am attempting to use the Exhibit pattern in a padrino application but to do so properly I need to access the rendering context. That is, I need to have some object context such that calling something along the lines of…
Carl Suster
  • 5,826
  • 2
  • 22
  • 36
1
vote
1 answer

Why am I getting a 405 on a POST request for JSON?

So I've got a Padrino app with a controller that looks roughly like this (simplified for brevity): App.controllers :questions do get :index, :with => :id, :provides => [:html, :json] do # Stuff end post :index, :with => :id, :provides =>…
Dan Tao
  • 125,917
  • 54
  • 300
  • 447
1
vote
1 answer

Padrino: determining route name in controller

Is there a way to determine within the padrino controller what the route name is? For example, in a before block, I'd like to be able to take some predetermined action based on the route. So, something like this: before do …
1
vote
1 answer

Implementing long-polling ajax with Sinatra

I have plenty of experience with Sinatra and Padrino. I use datamapper for database calls so before i learned that there is a programming model called comet programming, to implement a simple chat system, i was sending Ajax requests every moment to…
gkaykck
  • 2,347
  • 10
  • 35
  • 52
1
vote
1 answer

Why is Padrino rendering my views as escaped text?

I am using slim as my rendering engine. Here is my application.slim doctype html html head title Hello body = yield Here is my view ("views/welcome/index.slim") h1 Hello The application.slim is being rendered correctly,…
cbmeeks
  • 11,248
  • 22
  • 85
  • 136
1
vote
0 answers

How do Padrino sub apps work?

OK, so let's say I have two different projects. Each are are related categorically, but different databases and such. Example (projects): Project Management Help Desk Management A user could be a member of either project (or both). But I want to…
cbmeeks
  • 11,248
  • 22
  • 85
  • 136
1
vote
2 answers

Using LESS in the Padrino Ruby framework

I am pretty new to the Padrino framework (and ruby in general) and have been looking into using padrino's built-in support for the LESS CSS preprocessor for a new application I am developing. I decided to fully commit to LESS for this project as I…
Bill Dami
  • 3,205
  • 5
  • 51
  • 70
1
vote
1 answer

Running padrinorb after installing says "Could not find padrino-core"

EDIT: False alarm. I was able to resolve the issue. Apparently I was to sudo happy and that broke the install of the gem. I had to gem uninstall padrino, then gem install padrino. Now it works flawlessly. BTW, padrinorb is shaping up to be a nice…
aa4522ff
  • 51
  • 9
1
vote
1 answer

Padrino + sinatra-assetpack not working

I'm trying to combine Padrino with Sinatra-Assetpack, without success. This is my Gemfile: source :rubygems gem 'rake' gem 'sinatra-flash', :require => 'sinatra/flash' # Component requirements gem 'haml' # Assets requirements gem…
0
votes
1 answer

Padrino, name route differently from path?

I want to be able to follow a convention closer to what Rails does with resourceful routing. For example, I'm considering "signups" to be a resource, with it's own controller containing "new" and "create" actions. In app/controllers/signup.rb I…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
0
votes
1 answer

Padrino & Trinidad undefined method `register' for Rack::Handler:Module

Trying to run a sample_blog application Padrino framework based application on Trinidad throws weird error undefined method `register' for Rack::Handler:Module Using: trinidad-1.3.4 jruby-rack-1.1.4 Following is the stack trace ip-192-168-1-126: $…
Daya Sharma
  • 2,855
  • 2
  • 15
  • 12
0
votes
4 answers

RMagick - S3 - Heroku, problems with RMagick file open

I am trying to upload a file from browser, then make one thumbnail from it, then upload both to s3. File.open(params[:file][:tempfile]) do |p| AWS::S3::Base.establish_connection!( :access_key_id => settings.s3_key, …
gkaykck
  • 261
  • 1
  • 3
  • 11
0
votes
1 answer

Accessing url parameters in Padrino\Sinatra

I am building a simple application with Padrino I have set up a link to pass parameters as follows: .new_update=button_to pat(:new_update), url(:updates, :new), :status_notice_id => @status_notice.id, :method => :get, :class => :button_to Which is…
user841747