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

Padrino content_for rendering string instead of HTML

I have a Sinatra app and am using Padrino. When I use the content_for helper to render content within a layout it returns it as a string instead of html. app.rb class CateringApp < Sinatra::Application register…
kittyminky
  • 478
  • 6
  • 27
1
vote
2 answers

Padrino app not loading custom helpers when deployed to tomcat windows 7

I have a padrino app developed using jruby on linux, which works fine. However when I deploy it to Tomcat on Windows 7 using warbler, I get the following error when accessing a page: undefined local variable or method `authenticate' for…
kristianp
  • 5,496
  • 37
  • 56
1
vote
1 answer

i18n Padrino 0.12.2 with Mongoid 3.0.23 + Auto Locale

Repository: https://github.com/bcsantos/translate Live instance: http://ta-translate.herokuapp.com/ Live instance admin: http://ta-translate.herokuapp.com/admin (email: foo@bar.com pwd: foobar) Note as explained below, at the moment the only way I…
bcsantos
  • 2,635
  • 5
  • 21
  • 22
1
vote
0 answers

Padrino Admin (12.0) + Mongoid: escaped quotes break MongoDB array syntax

Whenever I edit an object with an array field with Padrino Admin interface, the quotes are escaped and MongoDB doesn't recognize the array as an array anymore. Fields are correctly defined as arrays in the object model definitions. Any…
bcsantos
  • 2,635
  • 5
  • 21
  • 22
1
vote
1 answer

How to specify output of command 'padrino rake routes'

I currently have multiple controllers but am only interested in seeing the terminal output of padrino rake routes for a specific controller. Is there a flag that can achieve this. Or commandline regex? Thanks internet!
dan-mi-sun
  • 551
  • 2
  • 4
  • 18
1
vote
1 answer

HAML / Ruby - Code Helper Blocks

I create something like this Which produces a partial - creates the code elements and renders the code partial I would like to wrap this all into one tidy element - ie calling the code partial will automatically render the partials inside the code…
Ian Warner
  • 1,058
  • 13
  • 32
1
vote
2 answers

Why can't Padrino find my rake tasks?

I just upgraded Padrino from version 0.10.5 to 0.12.1 and now none of my Rake tasks work anymore. A simple case I just added: # PROJECT_ROOT/lib/tasks/example_task.rake task :example_task do puts "Is this working?" end Running rake example_task…
GMA
  • 5,816
  • 6
  • 51
  • 80
1
vote
1 answer

How do I test that a particular template was rendered in Sinatra or Padrino?

Imagine you have two templates: # app/views/users/foo.haml.html %p ... # app/views/users/bar.haml.html %p ... And a controller that renders these: MyApp.controllers :users do get '/herp' do render 'users/foo' end get '/derp' do …
John Feminella
  • 303,634
  • 46
  • 339
  • 357
1
vote
0 answers

How to use ajax in Padrino framwork

I am a newbie of web develop, I am learning padrino framwork. But offical guide is lack of ajax content. Can any one supply me a doc or example for ajax in padrino? eg,modifiy div . I wrote a app,but ajax dont works fine.The refresh.js content is…
user2851100
  • 141
  • 2
  • 5
1
vote
2 answers

Rubinius + Padrino on production?

Is any one running padrino on Rubinius + Puma in production? If yes then how stable is it? Is it better than MRI + Thin? I am thinking of giving it a try but bit worried about its stability.
Kiran Raj
  • 187
  • 1
  • 9
1
vote
0 answers

Date Ranges not working after DataMapper update

def start_of_this_week today = Date.today today - today.cwday + 1 end def end_of_this_week today = Date.today start = today - today.cwday + 1 endday = start + 6 end rr = ReportRecord.first(:pupil => pupil, :report…
gkaykck
  • 2,347
  • 10
  • 35
  • 52
1
vote
1 answer

Keeping models and migrations in sync

My first time with Padrino and DataMapper. If I understood correctly, padrino g model Foo will make models/foo.rb as well as db/migrate/001_create_foos.rb. In order to create an index, I need to specify it in the model, not in the…
Amadan
  • 191,408
  • 23
  • 240
  • 301
1
vote
0 answers

to_specs': Could not find 'thor' (~> 0.17.0) - did find: [thor-0.18.1] (Gem::LoadError)

I am getting error in padrino to_specs': Could not find 'thor' (~> 0.17.0) - did find: [thor-0.18.1] (Gem::LoadError) . I could not find what to do. I have installed even thor-0.15.0, thor-0.17.0 also , But it was not working. same error I was…
Bharat
  • 13
  • 4
1
vote
1 answer

Padrino development host

How can I specify a default host and port for Padrino? Normally I could start my process like this: padrino start -h myhost I want to change the default parameters of start. I expected that to be done by editing the config/apps.rb…
SystematicFrank
  • 16,555
  • 7
  • 56
  • 102
1
vote
1 answer

LoadError on Windows when trying to generate a model

When trying to generate a model in a new Padrino project, I get the following: C:\temp\ruby\test>padrino g model client C:/Ruby193/lib/ruby/gems/1.9.1/gems/do_sqlite3-0.10.13-x86-mingw32/lib/do_sqlite 3.rb:32:in `require': 126: The specified module…
mydoghasworms
  • 18,233
  • 11
  • 61
  • 95