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

DataMapper can't convert string to integer enum

I have the following model class TagType include DataMapper::Resource ## Relationships belongs_to :category has n, :tags ## Properties property :uuid, UUID, :key => true, :default => lambda { |r,p| SecureRandom.uuid } property :name,…
joslinm
  • 7,845
  • 6
  • 49
  • 72
2
votes
0 answers

Rake migrate Error - database doesn't exist

I have a padrino project that uses data mapper and postgres. When I run padrino rake dm:create it says that the database is created. However, when I run padrino rake dm:auto:migrate, I get the error - FATAL: database "dbname_development" does not…
MParker
  • 315
  • 2
  • 3
  • 10
2
votes
1 answer

How to use Padrino helpers in a custom helper class

i want to use a custom notification helper to generate notifications (flash) messages in my Padrino app. Inside the helper i want to use the built-in Padrino helpers (flash and content_tag. (See example below) class NotificationHelper def…
Michael Wallasch
  • 2,499
  • 2
  • 17
  • 17
2
votes
1 answer

Inserting middleware in Padrino

I have a skeleton Padrino (0.10.7) project, with pretty much no code. I am trying to insert a middleware in boot.rb: ## # Add your after (RE)load hooks here # Padrino.after_load do DataMapper.finalize Padrino.use MyClass #Line (1) added…
constantine1
  • 427
  • 1
  • 5
  • 12
2
votes
1 answer

Padrino and RSpec don't work with Sequel?

Recently, I've started diving into Ruby MVCs, in order to find the best, fastest, most minimal framework to build my app. Being unsatisfied with Rails, I decided to try out Padrino. I'm also trying out Outside-in TDD for a full app for the first…
Kyle Lacy
  • 2,278
  • 1
  • 21
  • 29
2
votes
1 answer

Middleman 3.0 - simple-navigation gem

Would anyone with Ruby knowledge know if its possible to use the Padrino compatible version of the 'simple-navigation' gem with Middleman 3.0? I would like to implement multilevel navigation + breadcrumbs and have a bit of control over the…
user428071
2
votes
1 answer

Has anyone gotten Padrino to work with Sprockets and Compass?

I'm on Padrino 0.10.7 and I haven't been able to get Sprockets to recognize Compass in the load path.
Teffen Ellis
  • 113
  • 6
2
votes
1 answer

Linking to CSS from layouts using Padrino, Sass, and Slim

I'm currently using Padrino with Sass and Slim to markup a site that I'm making; however, I'm having trouble linking my CSS (converted from the Sass). My application.slim layout is as follows: doctype html html head title "test" …
Chris Covert
  • 2,684
  • 3
  • 24
  • 31
2
votes
1 answer

how to use padrino helper methods in rspec

I'm using padrino and rspec and I'd like to be able to test a helper method that I wrote. I have spec/app/controllers/sessions_controller_spec.rb describe "POST /sessions" do it "should populate current_user after posting correct…
jdkealy
  • 4,807
  • 6
  • 34
  • 56
2
votes
2 answers

Padrino doesn't see SCSS

Gemfile: # Component requirements gem 'bcrypt-ruby', :require => "bcrypt" gem 'sass' gem 'haml' gem 'coffee-script' gem 'activerecord', :require => "active_record" gem 'sqlite3' # Test requirements # Padrino Stable Gem gem 'padrino',…
2
votes
1 answer

Why \xF3 is not recognized as UTF-8

I have this hash: a={"topic_id"=>60693, "urlkey"=>"innovacion", "name"=>"Innovaci\xF3n"} and I am trying to save it to MongoDB using Mongoid, when I get this error: BSON::InvalidStringEncoding: String not valid UTF-8 I am then trying to gsub…
Cacofonix
  • 465
  • 11
  • 19
2
votes
1 answer

Padrino - Sass, Coffee - Encoding::UndefinedConversionError, from ASCII-8BIT to UTF-8

How to reproduce Gemfile gem 'haml' gem 'sass' gem 'coffee-script' app/app.rb get '/javascripts/rus_test.js' do content_type 'text/javascript', charset: 'utf-8' coffee :"../../public/javascripts/rus_test" end public/javascripts/rus_test.coffee…
the-teacher
  • 589
  • 8
  • 19
2
votes
2 answers

Searching for source code of coffee and scss methods

In my Sinatra/Padrino App I have require 'sass' require 'coffee-script' # Routes to COFFEE-JS and SCSS-CSS get '/javascripts/:name.js' do content_type 'text/javascript', charset: 'utf-8' coffee…
the-teacher
  • 589
  • 8
  • 19
2
votes
1 answer

Sessions & User Authentication in Padrino

I'm very new to Padrino (I come from a PHP background), and ruby web frameworks in general, and have been trying to figure out how to implement a simple user authentication and session management system, but have not really found much documentation…
Bill Dami
  • 3,205
  • 5
  • 51
  • 70
1
vote
2 answers

Profiling ruby memory usage on require call

I need to profile ruby gems memory usage. https://stackoverflow.com/a/164206/391229 suggests using system call to measure memory footprint, so ended up with aliasing require method and gathering stats. The top of the startup script (in my case it's…
ujifgc
  • 2,215
  • 2
  • 19
  • 21