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

Storing json object in Padrino CouchDB model

I’m currently working on Padrino application with CouchDB backend. I need to have a model to store json besides some general strings. The model looks like (in pseudocode): name: 'UniqueName', properties: { prop1: val1, prop2: val2 } I can’t predict…
Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
0
votes
1 answer

Ruby load module in test

I am running a padrino application and have started with the included mailers. I want to test that a mail is sent and had previously had no trouble accessing the Mail::TestMailer object to look at the mails delivered during the test. That is the…
Peter Saxton
  • 4,466
  • 5
  • 33
  • 51
0
votes
0 answers

Padrino console: How to search for a specific constant or method

Is there a way to do a search in all initialised constants, available methods, class names etc in a Padrino console session? Or any irb/pry based repl sessions? For instance, I see a method in a generated pages by the name: project_modules, wish to…
Jikku Jose
  • 18,306
  • 11
  • 41
  • 61
0
votes
0 answers

Fetch large data using multiple requests

My front-end is a Rails application, and my backend is a Padrino application. I want to fetch a large amount of CSV data from the backend. Doing makes the HTTP request timeout in the browser. I can not query the backend again and again, because…
akash
  • 1,801
  • 7
  • 24
  • 42
0
votes
0 answers

Anyways to access Padrino controller instance variables inside its models?

I wish to access a variable I am setting in controller in the model. Imagine the following: app/controllers/events.rb ... @language = language_from_query_string @events = Event.all render "events" ... app/models/event.rb ... def title …
Jikku Jose
  • 18,306
  • 11
  • 41
  • 61
0
votes
1 answer

Best strategy to store multiple translation records in DB

Assuming few fields (say under 6/7) whats the best strategy to store multiple language translation for DB records, consider the following two cases. Say we have a table with the following fields: id, title, description Every record will have an…
Jikku Jose
  • 18,306
  • 11
  • 41
  • 61
0
votes
0 answers

How to access Padrino model and database in a "standalone" (bin/) script?

In my Padrino App I define model classes that I want to use from a script in bin/ without actually serving something (e.g. pre-populate database with a command line tool). How can I access the model classes and database? I digged around the padrino…
Felix
  • 4,510
  • 2
  • 31
  • 46
0
votes
1 answer

How to access a gemified Padrino Apps Model from outside (not in controller, but e.g. a standalone script)

I have a Padrino App called Gusy that specifies (Sequel) Models like # gusy/models/seminar.rb class Seminar < Sequel::Model # hopefully irrelevant stuff defined here end I want to access this Model from either a second gem, or a script in…
Felix
  • 4,510
  • 2
  • 31
  • 46
0
votes
1 answer

How to render template to a variable in Padrino?

I'm trying to implement a nested form in Padrino where I can add multiple instances of the child object using a Add whatever button in the interface. In Rails, one method to do this is to create a helper that generates nested fields everytime you…
jdscosta91
  • 706
  • 1
  • 8
  • 16
0
votes
1 answer

NameError at / uninitialized constant Sass::SyntaxError

I am using Padrino and when I try to specify my application.sass file I get this error NameError at / uninitialized constant Sass::SyntaxError I thought I might have something missing, so I checked out the sample_blog application at their GIT to…
Ivo Sabev
  • 5,230
  • 1
  • 26
  • 38
0
votes
2 answers

Padrino: could not find mounted router after mount another project into main project

issue description : there are two project, one is main project, another project is timesheet_app. and I want to mount timeheet_app to main project. when access url http://localhost:3000/tsheet/base, it say "Sinatra doesn’t know this ditty" Try…
Hunter
  • 121
  • 1
  • 7
0
votes
1 answer

Padrino Sass in Haml not working

I am new to Padrino with little idea of haml/sass following sample blog tutorial from padrinorb.com. I have included sass gem in my sample project. When I run my sample project changes done to application.sass present in app/stylesheets does not…
Himanshu Virmani
  • 2,450
  • 1
  • 24
  • 34
0
votes
1 answer

Content management in Padrino with custom templates for pages

The point is to create a simple CMS with Padrino in which front-end content is object driven, i.e. aside from domain models of the app, there is a "Page" model and a "Content"/"Snippet" and maybe "Category" model. Looking at…
bcsantos
  • 2,635
  • 5
  • 21
  • 22
0
votes
1 answer

Padrino: how to send form data to app method

I'm having some trouble sending variables from a form to a post method which sends emails. The method receives the variable names instead of their content. Form = form_tag url(:amenities, :email_booking, name: :name, email_addr: :email, message:…
bcsantos
  • 2,635
  • 5
  • 21
  • 22
0
votes
1 answer

Setup multiple databases with Padrino + mysql

How to setup multiple databases for padrino + mysql web app. I already try "establish_connection" with activerecord. I found database not found problem.