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

How do I get the substring of a JSON output?

I want to render a simple JSON from an array. array = ["valueid",true] render :json=>array which returns: {"json":["valueid",true]} but I don't want the JSON. The only part I want is: ["valueid",true] Is there a simple way?
gkaykck
  • 261
  • 1
  • 3
  • 11
0
votes
1 answer

Padrino with RVM gemsets: uninitialized constant ActiveSupport::Deprecation

I'm getting an error trying to run an app, not even trying to do anything sophisticated either, just get the basic thing running... Just wondering if anyone can give me any pointers as to how to debug it. I suspect it might be to do with RVM…
purpletonic
  • 1,858
  • 2
  • 18
  • 29
0
votes
3 answers

Padrino: sharing layout between main project and sub apps

How can I use my main projects layout for my sub apps? There is a layout option for the controller.. but what would I set the value to in order for it to traverse back into the parent project and use it's application.haml instead? I tried…
Mike
  • 33
  • 3
0
votes
1 answer

Padrino basic user authentication

I was wondering if anyone can shed some light on setting up basic user authentication. I've installed the admin app into my project and it works great. But I need a basic user role that can have it's own registration page etc. I need to see…
Mike
  • 33
  • 3
0
votes
1 answer

padrino can't find active_support methods

In my Padrino application i'm trying to get the time 10 years from now using 10.year.from_now I'm getting: NoMethodError: undefined method `year' for 10:Fixnum Any idea why ?!
refaelos
  • 7,927
  • 7
  • 36
  • 55
0
votes
1 answer

Padrino model from json data

I have been looking at Padrino for a project I am working on, and it seems a great fit, as I would ideally be wanting to support data being sent and received as json. However I am wondering if there is any automated helper or functionality built in…
Grofit
  • 17,693
  • 24
  • 96
  • 176
0
votes
2 answers

Custom template for padrino admin page

How can I make padrino-admin page generator produce beautiful custom pages? By default padrino-admin generates pretty ugly admin pages, totally unmaintainable: .group =f.label :title =f.error_message_on :title =f.text_field :title, :class =>…
ujifgc
  • 2,215
  • 2
  • 19
  • 21
0
votes
1 answer

How do I log queries in a rake task using datamapper and padrino?

I have a padrino install that is using datamapper and logging queries to a file. This is working fine when browsing my application. But queries are not logged if executed inside a rake file. Why? This is how the task is defined: #…
marcosdsanchez
  • 2,529
  • 2
  • 17
  • 20
0
votes
0 answers

Two state machines in Single ruby class

Following are System Specifications := Language Ruby Framework Padrino ORM Mongoid Database MongoDB Now I have a Person model with two fields tat maintain states separately. class Person include Mongoid::Document include…
Jai Madhav
  • 603
  • 8
  • 17
0
votes
1 answer

padrino-gen migration create_indexes is not working

I am trying to use mongoid_fulltext and can't seem to get the migrations to create the indexes needed. When I try: padrino-gen migration create_indexes I get a result apply orms/mongoid But when I empty out a document and rebuild it, the new…
Jeremy Smith
  • 14,727
  • 19
  • 67
  • 114
0
votes
1 answer

How do I create a URL to link between apps in Padrino?

I have a separate app called "api" that I'd like to link to from my admin app. But if I do a link like: %td=button_to "API", url("/api/users", :attributes, :id => user.id), :method => :get, :class => :button_to It takes me to /admin/api/users,…
Jeremy Smith
  • 14,727
  • 19
  • 67
  • 114
0
votes
0 answers

Component in padrino framework?

padrino g component What is component in padrino? How to use it? What for? Please someone answer???
aaaa
  • 73
  • 1
  • 6
0
votes
0 answers

FrozenError - can't modify frozen Array - Error when trying to run brand new Padrino project

I created a new Padrino project with padrino generate project hello-padrino. When I attempt to run it with bundle exec padrino start I get the following error: ERROR - FrozenError - can't modify frozen Array:…
EJ_
  • 65
  • 4
0
votes
0 answers

How to attach debugger while starting the padrino server, without going to VS code and pressing F5

I run this command to start my padrino local server. Further while debugging I have to connect the VSCode debugger to this for the server start process to resume. This is just a little painful to start the server and then go to VS code to attach the…
imba22
  • 651
  • 1
  • 13
  • 25
0
votes
2 answers

Which version of Padrino runs fine in Ruby 1.8.6?

Padrino 0.10 gem installed activesupprt 3.0.9 which requires ruby >= 1.8.7. I am Working on Ruby 1.8.6 can any one suggest me which version of Padrino works fine with Ruby 1.8.6 ? I don't want upgrade Ruby version atleast for 5-6 months. This my…
Jai Madhav
  • 603
  • 8
  • 17