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

Store persistent instance of class in padrino/sinatra controller?

I've been trying to store a persistent instance of a class in my padrino controller, but am having some headaches. I'm currently just storing it as a class variable, but I'm getting warnings that looks like: warning: class variable access from…
abu
  • 948
  • 1
  • 7
  • 14
0
votes
1 answer

Why does Padrino ignore the content type and force "application/json"?

I'm trying to render an ERB template named "home.erb" in the folder "app/views/shared/". This is the code in my controller: get :show, :map => "/v1.0/crit_admin/", :provides => [:html] do render "shared/home", :layout => false end Whenever I…
abu
  • 948
  • 1
  • 7
  • 14
0
votes
1 answer

Subdomain routing to main domain

I'm using sub-domains within my Padrino configuration. I've created multiple A records in AWS Route 53 to route to things like api.myapp.com & admin.myapp.com, myapp.com, www.myapp.com. This is working as expected. Here's what my configuration looks…
joslinm
  • 7,845
  • 6
  • 49
  • 72
0
votes
0 answers

Unable to uninstall zurb-foundation

I installed zurb-foundation and sass using the steps on their getting started page e.g. [sudo] gem install compass cd path/to/where-you-want-your-project run compass create -r zurb-foundation --using foundation But now I would like…
Peter
  • 4,493
  • 6
  • 41
  • 64
0
votes
1 answer

Store a class instance in session server side w/ Padrino?

I have a class that reads from a DB on startup. I'd prefer to be able to store it in the session, but I get the following error when trying to do so: ERROR TypeError: no marshal_dump is defined for class Mutex Is what I'm doing possible/reasonable?…
abu
  • 948
  • 1
  • 7
  • 14
0
votes
1 answer

Padrino remote js form rendering as text instead of js

I'm learning to use padrino with haml and I get this weird behaviour while working with remote forms. The partial used for creation of an element works like a charm but the one used after the update renders in plaintext. I'm sure its a rookie…
quad
  • 35
  • 5
0
votes
0 answers

application.handlebars template isn't rendered (as it should be by default)

my goal is a simple js mvc appliction. i'm using padrino, and trying to add ember.js. also, i switched to asset pipeline in this project, just for simplicity. i have a problem with rendering a default application.handlebars template. it isn't…
0
votes
2 answers

MongoMapper with Padrino Forms Select

I am using mongomapper inorder to associate 2 models together in a one-to-many relationship. I want to show the ids of one model into the other models in the padrino admin section. I am trying to use the <%= f.select %> of padrino forms. to mimic…
zotherstupidguy
  • 2,976
  • 10
  • 39
  • 59
0
votes
3 answers

Syntax error in content type case statement

This is my code in my Padrino application and I can't figure out what line or bug it is. The error message is "syntax error, unexpected keyword_end expecting $end" get :index, :provides => [:html, :json] do @title = "Restaurants" …
Peter
  • 4,493
  • 6
  • 41
  • 64
0
votes
1 answer

Can't read an uploaded file with Ruby's Framework Padrino

I have this form for uploading files: -# coding: utf-8 - content_for(:body_classes, "body3") .content - form_tag url(:images, :create), :method => :post, :multipart => true do = file_field_tag :file = submit_tag "Upload" And this…
Luis Ortega Araneda
  • 865
  • 1
  • 12
  • 26
0
votes
1 answer

How to use Redis with Padrino

Is it possible to use redis with Padrino same as postgresql or mysql generators.
zotherstupidguy
  • 2,976
  • 10
  • 39
  • 59
0
votes
1 answer

Where do you set the access control headers in Padrino

In Ruby on Rails you can place the access control headers in the Application Controller. What about Padrino? where do you place them? I've tried placing them in the method of a Controller I need to use different headers and inside app.rb, but it…
Luis Ortega Araneda
  • 865
  • 1
  • 12
  • 26
0
votes
1 answer

Which is the right path to place an initializer in a Padrino sub application

I'm working with OmniAuth-Facebook and initializing it in mysubapp/app.rb: require 'omniauth-facebook' class MySubApp < Padrino::Application register Padrino::Rendering register Padrino::Mailer register Padrino::Helpers enable :sessions …
Luis Ortega Araneda
  • 865
  • 1
  • 12
  • 26
0
votes
2 answers

iterating over yaml data in middleman template

I have a list of projects in a yaml file which i'd like to dynamically loop thru for a template in a middleman app but am unsure how or if I even can/should do it more dynamically. I have: data.projects.each do |f| proxy…
ere
  • 1,739
  • 3
  • 19
  • 41
0
votes
2 answers

Sinatra not parsing array from params

I have a hidden form like this: = form_for movie, 'create', method: 'POST' do |f| - Movie.attribute_names.each do |attr| = f.hidden_field attr.to_sym, value: movie.send(attr) = f.submit 'Save this Movie', class: 'button' Some of this…
ichigolas
  • 7,595
  • 27
  • 50