padrino

Setup Padrino with DataMapper and MySQL database

Hello I am trying to setup a Padrino project using DataMapper and MySQL on my Mac OSX Snow Leopard. I have the necessary gems: dm-core data_objects do_mysql mysql (linked to my original Mac OSX installation) But when I try to start the padrino with PADRINO START from the console, I get the following error: /Users/ivolution/.bundle/rub...

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 verify my SASS is working correct. It was working correct and the blog app was running fine....

Heroku app throws "Internal Server Error"

This app works just fine on my local computer. After pushing it to Heroku, static pages appear to be working but the blog section throws an Internal Server Error. I pulled the logs by running "heroku logs" and this is what I get: ==> production.log <== /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:i...

How to detect language from URL in Sinatra

I have a multi-language website and I'm puting the language in the URL like domain.com/en/. When the user doesn't put the language in the URL I want to redirect him to the page in the main language like "domain.com/posts" to "domain.com/en/posts". Is there an easy way to do this with Sinatra? I have more than one hundred routes. So doin...

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 keys. Some of the keys have a finite set of allowable values. For example: item.params["pa...

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 -s jquery -d activerecord -a mysql padrino g admin I have all the dependencies in orde...

Heroku Postgresql error

I deployed an app that uses ActiveRecord to Heroku, and I got an internal server error. It works fine on my local machine (where the database is SQLite). Below is the log message for the error. The newsletters table is just a table with no associations. It's got just one field for email addresses. I don't know PostgreSQL, and I'm not sur...

ActiveRecord returns data in ASCII-8Bit Under Ruby 1.9.2-rc1.

Further to the title, when loading data from ActiveRecord the encoding is always set to ASCII-8Bit in spite of my best efforts to force the encoding. I have entered as much detail as possible here to try and build a good error report someone could use to help me out! The project is using the following technologies: Padrino Framework R...

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? ...

alias url with sinatra / padrino

I've this and it works get :about, :map => '/about_us' do render :erb, "<%= 'foo' %>" end get '/:slug' do redirect "/about_us" # <-- end Is possible to do in some way "render" instead of "redirect"? or something like render 'posts/1' ...

Padrino, compass and heroku's read-only file-system

I really like the way padrino 'just works' with compass but I have a few questions as I'm going to be using heroku (and their read-only file-system) for hosting From the looks of things, the padrino/compass combo only compiles sass if changes have been made to the sass file and a user hits the server. Is that true? If so, then am I ri...

If i learn Sinatra or Padrino does that help me with Rails?

I assume that for all of these i need to get a better understanding of Ruby itself but does (say) Padrino translate directly into skills i would use in Rails or is it indirect. I am a PHP programmer but as i have used PHP frameworks which are clones of Rails i am finding it not too difficult ...

Layout file on Padrino

Hello guys, 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 ...