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

Rails “ApplicationController” in Padrino?

While trying to figure out how to get Carrierwave + Mongoid + gridfs to work in Padrino (Carrierwave + Mongoid + gridfs + Padrino admin image upload), I came across some Rails code that looks like it might do the job, if i can get it to work in…
bcsantos
  • 2,635
  • 5
  • 21
  • 22
0
votes
1 answer

Padrino rspec controller testing always green

I am testing my controller with rspec on padrino with this code: https://gist.github.com/anonymous/8d0df4c189e99c7cb7ea If I run the test everythings goes fine and all the test will be green. The problem is that those test must fail! The…
Rex
  • 1
  • 3
0
votes
2 answers

RESTful routes in Padrino controllers

Padrino supports the idea of nested routes. Here's one example from the documentation: SimpleApp.controllers :product, :parent => :user do get :index do # "/user/#{params[:user_id]}/product" end get :show, :with => :id do #…
John Feminella
  • 303,634
  • 46
  • 339
  • 357
0
votes
1 answer

How would one test a custom Padrino FormBuilder?

Suppose we have a custom FormBuilder in Padrino, like the following: class CustomFormBuilder < Padrino::Helpers::FormBuilder::AbstractFormBuilder def foo(arg1, arg2, ...) # do something with #template end end What's the right way to test…
John Feminella
  • 303,634
  • 46
  • 339
  • 357
0
votes
0 answers

before filter issue in padrino

I'm trying to create a chain of before filter in padrino that look like this of which look like this before do set_current_user track_order_ip !current_user and pass ## don't allow the next filter other filter to run if no current user …
Ratatouille
  • 1,372
  • 5
  • 23
  • 50
0
votes
1 answer

Liquid template in Padrino can't get instance variable

I try to convert a ramaze app to padrino(0.12.1) Current problem that I have is instance variable in padrino/sinatra controller can't be read by liquid template. controllers/main.rb Myproject::App.controllers :main do get :index, :map => '/' do …
mhd
  • 4,561
  • 10
  • 37
  • 53
0
votes
1 answer

Nested form object fields not displayed

I'm using Padrino and trying to display an image upload field inside a form of an object that has many images. Model project.rb class Project < ActiveRecord::Base has_many :images, class_name: 'ProjectImage', foreign_key: 'project_id' …
leemour
  • 11,414
  • 7
  • 36
  • 43
0
votes
1 answer

Parameters in route are not resolved

I have this configuration in the controller in Padrino MyProject::App.controllers do get '/' do handlebars :index end get :file, :with => :tokenId do tokenId = params[:tokenId] [extra logic] end end GET / works. GET…
davidey
  • 35
  • 5
0
votes
1 answer

Padrino custom application extension

I have a Padrino project made of several applications and I want to write a module to avoid repeating this in every sub app: class MySubApp < Padrino::Application register Padrino::Rendering register Padrino::Helpers register Padrino::Warden …
SystematicFrank
  • 16,555
  • 7
  • 56
  • 102
0
votes
2 answers

Test helpers with RSpec in Padrino (Sinatra)

I'm trying to test a helper in a Padrino (Sinatra) app. My helper method is itself calling Padrino core helper methods but they are undefined. The error appears only in RSpec, while the app works fine. So the way I'm including my helper in RSpec…
leemour
  • 11,414
  • 7
  • 36
  • 43
0
votes
1 answer

Padrino 0.12.0, Compass 0.12.2, haml 4.0.5 and Zurb Foundation 5 ("camorra" plugin) - javascripts not working

I can't get Zurb Foundation to work correctly in Padrino. The stylesheets are compiled and loaded, but the Foundation modules don't work. http://intense-falls-2845.herokuapp.com/ is a haml version of…
bcsantos
  • 2,635
  • 5
  • 21
  • 22
0
votes
1 answer

How to render full view from Ruby (Padrino) server side after jQuery .ajax call?

Controller has these routes: (simple example for illustration) get :index do render "person/index" #this view has the .ajax action in it end put :update, :with => :id do @person = Person.find(params[:id]) render "person/details" end The…
Pelted
  • 81
  • 4
0
votes
1 answer

Date time selectors in padrino and Jquery using slim framework

I'm new in this tecs and i need to do a datetimepicker or something to choose a date vale.. is it any sort of "datetime_field"? or only is posible using Java sciprt or Jquery... I tried something like this in my code.. but nothing heppends =…
lyons
  • 89
  • 10
0
votes
1 answer

Resque worker not starting

I am using resque with padrino, and created a new worker when I call Resque.enqueue WorkerClassHere, 1 it shows up in the resque UI as a queue with a new pending job. However, when I try and start a worker for this queue nothing happens. I have…
amedeiros
  • 939
  • 2
  • 15
  • 24
0
votes
1 answer

Padrino cannot use output helpers in custom form builder

I am trying to create a custom form builder that generates a span with an error message. I keep getting the message NoMethodError at /class/create undefined method `content_tag' for…
Lee
  • 8,354
  • 14
  • 55
  • 90