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

Sequel Migration: uninitialized constant Jsonb (NameError)

I'm using Sequel with Padrino and the following migration raised the uninitialized constant Jsonb (NameError) error: Sequel.migration do up do alter_table :same_table do add_column :not_working, Jsonb end end end The create_table…
vladiim
  • 1,862
  • 2
  • 20
  • 27
0
votes
0 answers

Ruby Padrino - Back button functionality

I am having difficulty with logging in and the functionality of the back and forward buttons associated with a user who is logged in. When I log into the application from the login page I am directed to a page (lets call it logged_home). If I press…
0
votes
0 answers

How to add middleware class in padrino app

Could someone explain how to add a middleware class in a padrino application. The middleware class should enable trace point before processing an API request and disable the trace point after processing the API and serve the response to…
baig62
  • 169
  • 1
  • 7
0
votes
1 answer

undefined method for nil:NilClass in RSpec, even though manual test passes

I'm getting a very weird error, because it's all working perfectly in the browser i.e. the posts are displayed and the author's name is displayed. No errors. However, the feature test is breaking, and I have no idea why. It's very…
Yorkshireman
  • 2,194
  • 1
  • 21
  • 36
0
votes
1 answer

Padrino, mounting app for Capybara

I have a feature spec: /spec/features/posts_features_spec.rb: require 'spec_helper' describe "Displaying Posts" do it "can see posts on posts page" do Post.create(title: "Title", content: "Content") visit '/posts' expect(page).to…
Yorkshireman
  • 2,194
  • 1
  • 21
  • 36
0
votes
0 answers

How to render a partial containing if/ else statement in haml

I have a partial similar to this: / _some_partial.md.haml %div.container %div.optional-row = yield With a view like this: / some_view.html.haml --- layout: some_layout --- = partial "some_partial" do %p Content here ... However, I'd…
lukebm
  • 163
  • 11
0
votes
2 answers

How do I find the next record in an ActiveRecord set?

I am working in Padrino and have this in my controller @work.find_by_id(params[:id]) I want to add prev/next buttons into my view, and so must be able to get the path to the next item on the list. How can I do that with ActiveRecord?
picardo
  • 24,530
  • 33
  • 104
  • 151
0
votes
1 answer

undefined method `head?' using rabl

I am trying to get around this weird error for some time now. This is the basic controller I have: get :index, provides: :json do @requests = Request.order(:created_at) render 'requests/index' end get :show, with: :id, provides: :json do …
tselvan
  • 642
  • 3
  • 11
0
votes
1 answer

Alternative to _path

I am following a tutorial from railscast (http://railscasts.com/episodes/220-pdfkit) and have become stuck when trying to implement the link for a PDF. The original code was:
user3385136
  • 513
  • 1
  • 7
  • 20
0
votes
1 answer

Set headers in Padrino

I am attempting to remove caching and discovered this post: How to prevent browser page caching in Rails The problem it along with a number of other posts relating to ruby rails refer to an application_controller.rb file that my project does not…
user3385136
  • 513
  • 1
  • 7
  • 20
0
votes
1 answer

Padrino with mysql, rake fails

I just wanna give a try on the new frame Padrino. I followed the steps given here. I am stuck at running the rake tasks. I used Mysql as my database. I created the project using the command. padrino g project sample_blog -t shoulda -e haml -c sass…
Deepak
  • 2,481
  • 2
  • 23
  • 28
0
votes
1 answer

Complex hash editing with MVC/Padrino ruby 1.8.x

I'm new to MVC. I'm using Padrino with MongoMapper and Haml to try to create this application. I have a database of items, each of which has a hash associated with it called 'params'. This hash has some required keys, but mostly arbitrary/random…
Sam
  • 1
0
votes
2 answers

Save a pdf in mongodb with mongoid without GridFS

I want to save a small pdf file in a mongodb database. I use Ruby (2.0.0), Padrino (0.12.5) and MongoId (3.0.0), MongoDB(2.6). Since my filesize is around 1MB, I will not need the complexity of GridFS. I am new to MongoDB and expected that small…
Ben
  • 118
  • 8
0
votes
1 answer

Datamapper "Model.all()" method creates 3 selects and not selecting the right fields

I've started to use Datamapper with Padrino and i have some weird issue. The issues is explained below: 1.The code: content_type :json @fonts = Font.all(:fields=>[:id,:name,:class_name]) @fonts.to_json Datamapper executes 3 queries and return…
Yaniv Vova Alterman
  • 1,660
  • 1
  • 13
  • 11
0
votes
1 answer

Access Padrino settings from controller

I am trying to get values from Padrino.configure_apps block in config/apps.rb, but Sinatra way not working here. Anyone know the Padrino way to access the settings from controller ? Thankx in advance!
Yaniv Vova Alterman
  • 1,660
  • 1
  • 13
  • 11