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
0
votes
2 answers

How to dynamically populate a form based on previous input

I am new to RoR/Padrino. I want to add an autofil functionality to a form. Lets say when a User ID is entered The Name of the User is shown in the name field. And when a specific user type is selected a dropdown menu only shows entries matching the…
schnika
  • 79
  • 8
0
votes
1 answer

Replace default authentication strategy in Padrino-Warden

Im struggling to replace the default :password strategy for the Padrino-Warden gem. The way I figure it I need to get a hold of the manager instance for warden so I can set the default strategies but I'm not sure how to do that in the app.rb…
Erik Johansson
  • 1,188
  • 1
  • 8
  • 22
0
votes
1 answer

Identifying and differentiating among workers when using Backburner for Beanstalkd

I'm trying to use Backburner (a Ruby client for Beanstalkd) in my application to create, say, 50 workers all watching the same tube for incoming jobs. The problem is, each of those 50 workers, when performing a job, does some heavy file…
Vicky Chijwani
  • 10,191
  • 6
  • 56
  • 79
0
votes
1 answer

Padrino controller flow

I have been working on making an AJAX progress bar using a padrino framework. Using jQuery I make a GET request to a special page that will return to it a status update. But the actual rendering and processing take place on the POST page. Here's a…
Mister Mister
  • 33
  • 1
  • 8
0
votes
1 answer

DataMapper Associations 'NoMethodError'

I am stuck with a problem and can't figure out where the problem is. Because I am relatively new you can hopefully help me :). First of all I am using padrino with the datamapper gem. I have a Trip and Accommodation model with a one_to_many…
schnika
  • 79
  • 8
0
votes
1 answer

Padrino + bootstrap

Is there a gem that will allow me to use twitter bootstrap themese/UI with Pedrino ? Any pointers to relevant resources appreciated.
codeObserver
  • 6,521
  • 16
  • 76
  • 121
0
votes
2 answers

Most appropriate place to require library in Padrino/Sinatra

I'm using "therubyracer" in a model, and I'm requiring at the top of the model as so: require 'v8' class Thing def self.ctx; @@ctx ||= V8::Context.new; end; def self.eval(script); ctx.eval(script); end; end However, I intermittently…
Allyl Isocyanate
  • 13,306
  • 17
  • 79
  • 130
0
votes
0 answers

Handling a file upload within the padrino framework

I am building a small file upload service using the Sinatra framework with Padrino. I am pretty new to the whole world of html, php, rails style development, all of it. When using just a file_field_tag, I can generate a generic html file field tag,…
Mister Mister
  • 33
  • 1
  • 8
0
votes
2 answers

How to use content_for & yield_content in middleman using slim

I've tried prepending content_for with =, == or - without luck :) index.slim - content_for(:senarios) do h1 Some content layout.slim == yield_content(:senarios) Hope somebody got a solution.
lajlev
  • 772
  • 2
  • 7
  • 22
0
votes
1 answer

Padrino: undefined method session for model

I am keep getting "NoMethodError at /dataset_requests/create undefined method `session' for #". DatasetRequest is a model, not controller. The problem is caused by flash and redirect methods. What might be the problem? My controller: Ims.controllers…
Jacek
  • 1,894
  • 5
  • 21
  • 34
0
votes
2 answers

Rails 3 insert data into junction table automatically

I would have thought that if a table relationship is set up properly in a model file, ActiveRecord would take care of updating and inserting the data into the junction table. Is this not so? For example, I have a dvd.rb model that looks like…
kakubei
  • 5,321
  • 4
  • 44
  • 66
0
votes
1 answer

Can I get automatic HTML escape in Padrino?

Rails 3+ has automatic XSS prevention. Can I get the same thing in Padrino, and if so, how?
François Beausoleil
  • 16,265
  • 11
  • 67
  • 90
0
votes
0 answers

Padrino app not aware of its own root path

I have a Padrino app which doesn't seem to be aware of its own root path. The app works fine, but when I try to require a file I wrote and put into the models folder, it says it cannot find it. The file is required from within another file in the…
kakubei
  • 5,321
  • 4
  • 44
  • 66
0
votes
2 answers

Sinatra as backend (API) for Rails app or padrino or any hybrid solution?

Is it a good idea to build backend APIs in Sinatra for Rails app. Or is it better to use Padrino? I want to have my backend provides API as service, so that anytime, if I have to develop same app for any client, I can use that back-end API (web…
JVK
  • 3,782
  • 8
  • 43
  • 67
0
votes
1 answer

Call subapp route within Padrino app

I would like to call a route that is mapped to a sub app within a given Padrino app. What is the best way to do this? For example, say I need to call /subapp/create as part of running /mainapp/create. I do not want to simply link to it, but actually…
Jeff Erickson
  • 3,783
  • 8
  • 36
  • 43