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

Omniauth-ldap invalid credentials

I'm having a heck of a time getting omniauth-ldap to work properly with our AD server, and I believe it is because our usernames have our Domain Names in them. This will successfully connect to our ldap server: ldapsearch -h ldap.ourdomain.com -b…
Oranges13
  • 1,084
  • 1
  • 10
  • 33
1
vote
1 answer

Unable to alter table with unique constrain using Sequel and Sqlite3

These are my migrations for the table users_hobbies: Create: Sequel.migration do up do create_table :users_hobbies do Integer :user_id Integer :hobby_id end end down do drop_table :users_hobbies …
Jikku Jose
  • 18,306
  • 11
  • 41
  • 61
1
vote
3 answers

Heroku Postgresql error

I deployed an app that uses ActiveRecord to Heroku, and I got an internal server error. It works fine on my local machine (where the database is SQLite). Below is the log message for the error. The newsletters table is just a table with no…
picardo
  • 24,530
  • 33
  • 104
  • 151
1
vote
0 answers

How do I get angular resource to return data as json instead of individual characters?

I have an API built in padrino (ruby framework) that is returning api data in json format, and I'm building an angular app on top of it to read/create/update/delete from it. When I do a console.log(data) below I get the horrible resource character…
Nona
  • 5,302
  • 7
  • 41
  • 79
1
vote
1 answer

Padrino + FactoryGirl not performing Lazy Loading

I'm developing my thesis on Padrino, using Active Record as ORM and FactoryGirl as Mocking framework. I'm facing a strange behavior. I've two models: User and Rate. - User has a 'has_many :rates' association; - Rate has a 'belongs_to :user'…
Mauricio Klein
  • 527
  • 2
  • 12
1
vote
1 answer

In Padrino, where does access_control come from?

The Padrino Admin Guide (http://www.padrinorb.com/guides/padrino-admin) has the object "access_control", but it is not clear to me where it is set? I can guess, but that is not good enough. We have essentially: class Admin < Padrino::Application …
rtfminc
  • 6,243
  • 7
  • 36
  • 45
1
vote
1 answer

Having troubles with "all" method and getting "ArgumentError at"

I'm having troubles using the method "all" in this code: posts = Post.includes(:account).all(:conditions => condition, :order => "created_at DESC", :limit => postsPerPage, :offset => (page-1)*postsPerPage) When i start the server and go…
Andres Perez
  • 67
  • 1
  • 3
  • 9
1
vote
1 answer

Set Integer To Zerofill In Sequel Migration (Ruby ORM)

I'm trying to build a migration which would include an IP Address as a zero-filled unsigned integer. My migration looks something like this currently but zerofill: true is not working up do create table :ip do Integer :id, size: 7, default:…
kkirsche
  • 1,217
  • 2
  • 15
  • 38
1
vote
1 answer

Padrino/Sinatra: how modify response in "after" filter?

I can't really get my head around it. Let's say I have a controller as follows: get :test do status 201 body "test" end after do status 404 body "not found" end Now, visiting /test produces response with status 404 and body "test". How do…
jahmaican
  • 162
  • 2
  • 8
1
vote
1 answer

Can't get custom error pages to work in Padrino

I started to build a website with padrino. At the moment the main class of my app is the simplest thing in the world: class App < Padrino::Application enable :sessions get :index do send_file 'public/view/index.html' end error 404 do …
jahmaican
  • 162
  • 2
  • 8
1
vote
1 answer

Heroku thinks my Padrino app is Rails when I use Neo4j

I'm relatively new to a lot of the stack I'm using and have run into a problem deploying to Heroku. I'm hoping this is a simple thing as I'm not very familiar with Heroku even though I've trawled StackOverflow, Heroku's site, Google and everywhere…
Gav
  • 13
  • 3
1
vote
2 answers

Padrino Tutorial: Can't Modify Frozen String (Runtime Error)

I am following the Padrino tutorial from here: https://www.padrinorb.com/guides/blog-tutorial I am copy and pasting the commands but I quickly ran into an error I don't understand: $ padrino g controller posts get:index get:show create …
Bill Prin
  • 2,498
  • 1
  • 20
  • 27
1
vote
0 answers

Padrino Admin Screen

I am working on the Padrino admin screen and would like to show a dropdown list using haml in the edit view. In the List view I would like to show the country name rather than the id number it shows is this possible? I am a very newbie to haml. I am…
1
vote
0 answers

Datepicker in Padrino form builder

Why isn't there a Date picker control in Padrino form_builder? Seems to be unnatural to be left out. Is there a reason behind it?
Jikku Jose
  • 18,306
  • 11
  • 41
  • 61
1
vote
3 answers

Is it possible to deploy two different sinatra/padrino projects in the same server?

I'm planning to build several tiny apps in Sinatra or Padrino and deploy them on the same server for sake of economy. Each app will be its own independent domain name (not subdomain), e.g.: www.foo.com -> Project /foo www.bar.com -> Project…
Sony Santos
  • 5,435
  • 30
  • 41