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

"padrino rake sq:migrate -e development"doesn't update collection

I would like to add one more field to accounts table. So I have done this 1) padrino g migration AddPhoneNumberToAccounts phone_number:string This make a migration file named 038_add_phone_number_to_accounts.rb 2) and I migrated. padrino rake…
Nomura Nori
  • 4,689
  • 8
  • 47
  • 85
0
votes
1 answer

How to customize cron job in ruby application?

I have been developing a backend with padrino ruby framework and I would like to build a cron job. This is what I have done. gem 'whenever', :require => false wheneverize . inside schedule.rb every 1.minute do rake "cronjob" …
Nomura Nori
  • 4,689
  • 8
  • 47
  • 85
0
votes
1 answer

humanize NoMethodError on padrino-0.14.1.1

I used padrino-0.14.1.1 and activesupport-5.1.1 in combination and I generate padrino admin app. When I display the login page (/admin/sessions/new) the following error occurred and become 500 error page. DEBUG - TEMPLATE (0.0007s)…
constdrop
  • 64
  • 4
0
votes
0 answers

padrino with sequel posting to multiple models with one form

I am trying to post and save the form, which contains data for 2 models, they are connected with associations. But it fails on Sequel::MassAssignmentRestriction that the method for column from associated table does not exists. I understand the…
Mlok
  • 155
  • 9
0
votes
1 answer

Caching pages with query strings in padrino-cache

I have Padrino caching working in my app, e.g. get :blog, cache: true do # do a blog listing end But when the listings are paginated with will-paginate, it can't tell the difference between /blog and /blog?page=2, and always renders the cached…
velvetkevorkian
  • 660
  • 1
  • 5
  • 13
0
votes
1 answer

Create text data type in sequel migration

alter_table(:pages) do add_column :about, Text end when running the migration rake sq:migrate I get rake aborted! NameError: uninitialized constant Text How do i create a text data type. I did follow the docs but sequel doc has very…
Raaz
  • 1,669
  • 2
  • 24
  • 48
0
votes
1 answer

Rendering partial in a controller fails after submitting a remote form

This code snippet is extracted from a controller route. The intent is to render the partial after the form has being saved. post :create, :provides => :js do @note = Note.new(params[:note]) if @note.save "$('form').after('

#{…

Eli
  • 85
  • 1
  • 8
0
votes
1 answer

How can I separate templates by data in jbuilder

I want to make following data with jbuilder. How can I make jbuilder separated? data: [{ type: "top" logo: "logo.png" title: "title" },{ type: "nav" background: "bg.png" content: "
Welcome
" },{ type: "footer" content:…
yongwoon
  • 155
  • 2
  • 10
0
votes
1 answer

Layout file on Padrino

Is it possible to use the same layout file across different (mounted) apps without some hackish solution (i.e. sym links) on Padrino ? Cheers, Ze
user361526
  • 3,333
  • 5
  • 25
  • 36
0
votes
1 answer

Getting Errno::ENOENT: No such file or directory - createdb in a padrino api when creating a database in docker

I am pretty new in padrino so I have been struggling with this for a while and it is really blocking me. What I am trying to do is, to dokerize my padrino project in order to make it available to my front end co-workers so they don't need to spend…
0
votes
1 answer

select vs distinct vs uniq?

I am confused by Ruby's ActiveRecord uniq method. I am using it to try to get back an array of complete objects, not just a particular field. In my Padrino app script, which saves newspaper names and scores as Score objects, the uniq method by…
Jonathan_W
  • 638
  • 9
  • 24
0
votes
1 answer

upload image and files padrino

i want to put index image to my blog's posts and have an upload form in 'new post 'in admin's panel the form is written like this : - error = @post.errors.include?(:file) %fieldset.control-group{:class => error ? 'has-error' : ''} =f.label…
0
votes
1 answer

How to render partial haml on controller in padrino?

I'm doing a ajax request. The backend might render a partial haml and return it. I'm getting this error Padrino::Rendering::TemplateNotFound at /feedhtml backend code render :partial => 'feedhtml', :layout => false Also I tried a tons of…
Fernanda Fentili
  • 169
  • 2
  • 11
0
votes
1 answer

foreman start: exited with code 0 error

I am trying to start up my Ruby project from my Windows machine and when I SSH into my vagrant box, navigate to foreman, and then try to run foreman start I receive the following error. 01:54:14 web.1 | started with pid 12002 01:54:15 web.1 |…
Cow
  • 764
  • 5
  • 10
  • 25
0
votes
1 answer

Getting Paperclip::AdapterRegistry::NoHandlerError when using Padrino

I've been getting an issue where when using Padrino and paperclip whenever I try to upload an image I get the error Paperclip::AdapterRegistry::NoHandlerError What's going wrong?
HaloZero
  • 475
  • 4
  • 15