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

How to upgrade ruby version in Amazon Linux system?

I have developed ruby application using padrino ruby framework. And I would like to deploy it on Amazon. I used this image. Amazon Linux AMI 2017.09.1 (HVM), SSD Volume Type And image description was: "The Amazon Linux AMI is an EBS-backed,…
Nomura Nori
  • 4,689
  • 8
  • 47
  • 85
18
votes
1 answer

Suitability of Rails, Padrino, and Sinatra for building a prepaid mobile service

I am working on an application in the Mobile/VOIP domain. This is really a gray area for me. Here are some details about the application: This is basically like an auto recharge / prepaid mobile service Will have logic of medium complexity…
Jai Madhav
  • 603
  • 8
  • 17
17
votes
4 answers

Ruby localization: i18n, g18n, gettext, padrino... - what's the difference?

Being somewhat new to Ruby I'm exploring existing libraries to do what I'd normally do in other scripting languages, and I'm a bit stumped by the localization libraries that might be available for something built on top of Sinatra/Sequel (Rails/AR…
Denis de Bernardy
  • 75,850
  • 13
  • 131
  • 154
16
votes
3 answers

How do I test a redirect in sinatra using rspec?

I'm trying to test for a redirect on the homepage in my sinatra app (more specifically, a padrino app), in rspec. I've found redirect_to, however it seems to be in rspec-rails only. How do you test for it in sinatra? So basically, I'd like something…
zlog
  • 3,316
  • 4
  • 42
  • 82
16
votes
1 answer

Hacking rails.vim to work with Padrino

I recently cloned rails.vim (vim-rails) hoping to modify it to work with Padrino projects. Currently I'm trying to get the Rcontroller command to look not only in app/controllers (perfect for rails) but also in any folder in the project that has a…
gcahill
  • 3,155
  • 1
  • 17
  • 11
12
votes
2 answers

Several optional parameters in sinatra route

I need the Sinatra route to behave in the following manner: GET /list/20/10 # Get 20 items with offset 10 GET /list/20 # Get 20 items with default offset GET /list # Get default number of items with default offset I understand, I might…
Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
7
votes
2 answers

Store websocket connection to redis

I'm using websocket-rack to build a chat application API. I would like to store the websocket connections (which ends up being an instance of Rack::WebSocket::Handler::Base::Connection) in redis, so that they can be filtered and referenced from…
fridgerator
  • 323
  • 7
  • 17
6
votes
1 answer

Use cases for the different Padrino haml helpers

I read http://www.padrinorb.com/guides/application-helpers but I'm unclear as to what are the use cases for each of the view helpers. Specifically, how do content_for/yield_content, render/partial, capture_html, and concat_content all fit together?…
ghostfly
  • 728
  • 5
  • 12
5
votes
4 answers

Authentication and authorization solution for Padrino

I have been programming with both Sinatra and Padrino for quite some time now. However, I am still not able to find the right authentication and authorization solution for Padrino. Let me explain my expectation and what I have already tried…
Abhas Abhinav
  • 51
  • 1
  • 3
5
votes
2 answers

Using Nokogiri to generate static header list in Slate/Middleman

I'm inexperienced with middleman and ruby, but I've been trying to get Slate working so it generates a side navigation/list of header during build time instead of client side using javascript. The problem I am running into is getting the code to…
Alyss
  • 1,866
  • 1
  • 13
  • 27
5
votes
2 answers

ActiveRecord returns data in ASCII-8Bit Under Ruby 1.9.2-rc1

Further to the title, when loading data from ActiveRecord the encoding is always set to ASCII-8Bit in spite of my best efforts to force the encoding. I have entered as much detail as possible here to try and build a good error report someone could…
Lee Hambley
  • 6,270
  • 5
  • 49
  • 81
5
votes
0 answers

Padrino authentication between apps, to use e.g.: logged_in?

I was following the Blog Tutorial of Padrino and now I'm faced with the problem that I have two apps: Admin, App and I don't know how to access the authenticated account coming from Admin inside App. For example, inside views/posts/show.haml I want…
lmerino
  • 173
  • 2
  • 11
5
votes
2 answers

Why does HAML throw encoding ISSUE when ERB and ERUBIS dont

Please follow the code: __ENCODING__ # => # Encoding.default_internal # => # Encoding.default_external # => # Case 1: HAML throws Encoding::UndefinedConversionError string =…
Ratatouille
  • 1,372
  • 5
  • 23
  • 50
5
votes
1 answer

How to access current_account in models in Padrino?

I'm working on a Padrino application that has a main App and an Admin app. When a user logins through session, I just run the following two lines to log him in. account = Account.authenticate(params[:email],…
Kevon
  • 137
  • 2
  • 8
5
votes
2 answers

Send emails with Padrino in Heroku

I'm trying to send emails via sendmail in Padrino. I did the configuration specified here (Configuration and Quick Usage) But I always get the following error in the server log (on Heroku or localhost): app[web.1]: sh: Illegal option - app[web.1]:…
Luis Ortega Araneda
  • 865
  • 1
  • 12
  • 26
1
2 3
25 26