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

alias url with sinatra / padrino

I've this and it works get :about, :map => '/about_us' do render :erb, "<%= 'foo' %>" end get '/:slug' do redirect "/about_us" # <-- end Is possible to do in some way "render" instead of "redirect"? or something like render…
user142913
  • 883
  • 1
  • 7
  • 14
2
votes
1 answer

Using Padrino with Sequel, Can Migrations Create Singularly Named SQL Tables?

I'm looking to build an application using the Padrino Framework with Sequel as my ORM. The problem is that I need to interface with an existing database which was created using singularly named tables. Rather than renaming the SQL tables (as other…
kkirsche
  • 1,217
  • 2
  • 15
  • 38
2
votes
1 answer

Fetching active record associations in batches with include

Assuming standard simple models as following: class User < ActiveRecord::Base has_many :posts end class Post < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base end And my queries: includes = {:posts =>…
Saurabh
  • 71,488
  • 40
  • 181
  • 244
2
votes
5 answers

Padrino Project Generator Fails - Undefined Method `add_builtin_type'

I'm new to both Ruby and Sinatra/Padrino so I apologize if I'm missing something really simple. I have Sinatra working fine, as I can build a very simple "hello" app and see it work. I wanted to move on and generate a new Padrino project, but when I…
Dave Munger
  • 479
  • 3
  • 11
2
votes
1 answer

Find controller name inside view in Padrino

How can I access the controller name inside a partial or a view thats rendered by the controller. I want to create a dynamic template that changes depending on the controller rendering it, whats the best way to do it? I would prefer to access the…
Jikku Jose
  • 18,306
  • 11
  • 41
  • 61
2
votes
1 answer

Setup Padrino with DataMapper and MySQL database

Hello I am trying to setup a Padrino project using DataMapper and MySQL on my Mac OSX Snow Leopard. I have the necessary gems: dm-core data_objects do_mysql mysql (linked to my original Mac OSX installation) But when I try to start the padrino with…
Ivo Sabev
  • 5,230
  • 1
  • 26
  • 38
2
votes
1 answer

How to dry up (failing) entity fetching in sinatra/padrino app/controller?

In building Sinatra or Padrino apps, I often write code like get '/resource/:id' do resource = Resource.find(params[:id]) return status 404 if resource.nil? # .. end Or actually, I like to flash[:warning] = "A Resource with id #{params[:id]}…
Felix
  • 4,510
  • 2
  • 31
  • 46
2
votes
0 answers

SQLite3::IOException: disk I/O error

Since this question seems to be abandoned, I'm going to make an expanded version here. Similarly to the other question I get a SQLite3::IOException: disk I/O error when running a rack based application through phusion passenger as soon as the app…
Camden Narzt
  • 2,271
  • 1
  • 23
  • 42
2
votes
2 answers

Setting up Time.zone in Padrino

I am having a trouble setting the default ActiveSupport::TimeZone in my padrino project. In my boot.rb I have Padrino.after_load do Time.zone = 'UTC' ActiveRecord::Base.default_timezone = :utc end My controller file has: MyApp::App.controllers…
Moemars
  • 4,692
  • 3
  • 27
  • 30
2
votes
2 answers

Carrierwave + Mongoid + gridfs + Padrino admin image upload

i'm trying to get carrierwave + mongoid + gridfs to work for uploading images via padrino admin and then showing on front-end. at a loss as to glue everything. can someone help? following…
bcsantos
  • 2,635
  • 5
  • 21
  • 22
2
votes
3 answers

map in scope in active record

I have a active record, where I have a usecase: I want to use map in the ActiveRecord scopes. Following is my code: class SupportedGeoIdAndLocation < ActiveRecord::Base scope :supported_geo_ids, lambda { all.map(&:geo_id).uniq } #…
Saurabh
  • 71,488
  • 40
  • 181
  • 244
2
votes
1 answer

Uninitialized constant while trying to include helper module

The module that I am trying to include is located here: test/unit/helpers/test_helpers.rb Looks like: module TestHelpers end I am trying to include it in: test/unit/app/models/abc.rb class Abc < ActiveSupport::TestCase include…
Vivek
  • 153
  • 1
  • 2
  • 9
2
votes
1 answer

How to translate text which contains url link using gettext and haml?

I would like to know if it is possible to use fast_gettext the translate a short paragraph which contains a url link. I'm using a combination of padrino, haml and fast_gettext. For example: Please visit our home page. Inside the .haml file, the…
carbotex
  • 569
  • 1
  • 6
  • 16
2
votes
1 answer

Padrino custom log file

I need to create a custom log file within Padrino that contains all of the logging information that is in stdout as well as custom log messages. I have been able to get the custom log file created, but the stdout file (development.log,…
shakin
  • 171
  • 15
2
votes
1 answer

How do I stop a program on AmazonAWS?

I am using AmazonAWS server to run my application. To start the application I am using: RACK_BASE_URI=/project bundle exec rackup -D To stop the application I am using: ps -ef|grep pkill Even then the application is running. Can…
Ramesh
  • 347
  • 3
  • 11