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
3
votes
8 answers

If I learn Sinatra or Padrino, does that help me with Ruby on Rails?

If I learn Sinatra or Padrino, does that help me with Ruby on Rails? I assume that for all of these I need to get a better understanding of Ruby itself, but does (say) Padrino translate directly into skills I would use in Ruby on Rails or is it…
PurplePilot
  • 6,652
  • 7
  • 36
  • 42
3
votes
1 answer

Trying to avoid "attack reported by Rack::Protection::AuthenticityToken" message

I have a new Padrino 0.13.1 project that I am hosting on an AWS Elastic Beanstalk worker instance. The worker instance has a cron job that calls a POST every 5 minutes in my Padrino app. I have defined the routine as follows: post :myroutine, :with…
CyberFerret
  • 275
  • 3
  • 8
3
votes
3 answers

Padrino, compass and heroku's read-only file-system

I really like the way padrino 'just works' with compass but I have a few questions as I'm going to be using heroku (and their read-only file-system) for hosting From the looks of things, the padrino/compass combo only compiles sass if changes have…
stephenmurdoch
  • 34,024
  • 29
  • 114
  • 189
3
votes
2 answers

Ruby/Sinatra: Passing a URL variable to an .erb template

I'm using Padrino, and I want to take parameters out of URL and use them in an .erb template. In my app setup I have: get '/testpage/:id' do userID = params[:id] render 'test/index' end In my test/ folder I have index.html.erb which is…
JVG
  • 20,198
  • 47
  • 132
  • 210
3
votes
1 answer

Padrino websockets + Heroku; Connection closed before receiving a handshake response

I am using padrino websockets (https://github.com/dariocravero/padrino-websockets) to provide a chat system for my site, and it works great on my local machine. However, after deploying to heroku (free), the websocket won't make a connection and…
kRIST-
  • 186
  • 1
  • 7
3
votes
1 answer

How to detect language from URL in Sinatra

I have a multi-language website and I'm puting the language in the URL like domain.com/en/. When the user doesn't put the language in the URL I want to redirect him to the page in the main language like "domain.com/posts" to "domain.com/en/posts".…
basex
  • 490
  • 4
  • 11
3
votes
3 answers

Heroku app throws "Internal Server Error"

This app works just fine on my local computer. After pushing it to Heroku, static pages appear to be working but the blog section throws an Internal Server Error. I pulled the logs by running "heroku logs" and this is what I get: ==> production.log…
picardo
  • 24,530
  • 33
  • 104
  • 151
3
votes
1 answer

Running test cases in Rails/Padrino console

Hi I am trying to run test cases from padino/rails console running in test environment. I am unable to get the proper method invocations used by rake task to invoke test-unit library. Running testcases from padrino/rails console should reduce the…
Sujith Ej
  • 111
  • 1
  • 4
3
votes
1 answer

testing padrino post methods are stopped by csrf

I have a padrino controller with a single post method and a single get method. I can use rack-test to test the get method but not the post method. When I am testing the request returns 403. I think this is because of padrino's built in csrf…
Peter Saxton
  • 4,466
  • 5
  • 33
  • 51
3
votes
1 answer

SocketError at / getaddrinfo: nodename nor servname provided, or not known padrino

I am trying to use padrino to build a dashboard for my amazon environment. But when I try the following piece of code in the controller: get :index, :map => "/" do AWS.config(access_key_id: 'ACCESS_KEY', secret_access_key:…
3
votes
1 answer

Problems reading a Boolean value in a Padrino/Datamapper app

I am working on a Padrino project that uses Datamapper as the ORM. I have a User class that looks something like this: class User include DataMapper::Resource property :id, Serial property…
CyberFerret
  • 275
  • 3
  • 8
3
votes
1 answer

Cannot connect to Postgres via Sequel

I am trying to use Padrino with Sequel and Postgres and am having no luck connecting. In my pg_hba.conf I set the postgres user to 'trust' so no password is required (and can log in using PgAdmin without a password). # TYPE DATABASE USER …
Lee
  • 8,354
  • 14
  • 55
  • 90
3
votes
2 answers

Ruby - no PID found in tmp/pids/thin.pid (Thin::PidFileNotFound)

I'm trying to start thin for my app but then the pid cannot be generated: $ thin -C /var/www/project_path/current/config/myproject.testing.yml start Now I can't stop it because there is no pid: $ thin -C…
tokhi
  • 21,044
  • 23
  • 95
  • 105
3
votes
2 answers

Bundle update for padrino app: could not find compatible versions for "tilt"

Running bundle update on my padrino app gives me: Bundler could not find compatible versions for gem "tilt": In Gemfile: padrino (= 0.11.1) ruby depends on tilt (~> 1.3.0) ruby padrino (= 0.11.1) ruby depends on tilt…
Daniel May
  • 2,192
  • 5
  • 25
  • 43
3
votes
1 answer

How do I enable logging for a Padrino app on Heroku?

Help me out here; I must be missing something really obvious. I have a Padrino app running on Heroku. In boot.rb, in the block passed to Padrino.before_load, I have the following lines: Padrino::Logger::Config[:production][:log_level] =…
Dan Tao
  • 125,917
  • 54
  • 300
  • 447
1 2
3
25 26