to create a Gallery that has a name and has_many :images, which in turn have a...

Simple: Tell the application controller how to handle exceptions, here a RecordNotFound error. Do this with the following line: # application_controller.rb...

makandra dev

Remove fastercsv Remove cucumber_spinner Remove rspec_spinner Update rspec to '< 2' Lock haml to '= 3.1.7' Unlock andand Unlock rake Lock test-unit to '= 1.2.3' Lock database_cleaner to...

makandra dev
css-tricks.com

Now use the mixin below to fit an image into a container. Example: # HAML .image = image_tag post.image # SASS .image +object-fit(cover, $aspect-ratio: 52%) Sass Mixin

...for IE up to version 8 only (the first part is not possible in Haml, so use ERB): <%= stylesheet_link_tag 'screen', :media => 'screen' %> These would be your two screen...

makandra dev

...site you can generate your CSS through Sass. Install Sass with sudo gem install haml Create a folder sass in the folder, that stores your stylesheets, e.g. mkdir css/sass

...at StaticMatic. This works like an extremely stripped down version of Rails, giving you HAML SASS helpers partials When done, everything is simply compiled to static HTML and CSS, so...

...variable @foo. You can do this by using ERB tags (<%= ruby_expression %>) or, in Haml, interpolation syntax (#{ruby_expression}). In any case you will take care of proper quoting and...

...formats like this: {:locale=>[:de], :formats=>["../../../../../../../../../../etc/services{{"], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :haml]} or fails like this: Invalid query parameters: invalid %-encoding (../../../../../../../../../etc/passwd%%0000.html) Someone tries to exploit...

makandra dev
stackoverflow.com

...fix some other things, too) by adding this meta tag to your : Or in Haml: %meta(http-equiv="X-UA-Compatible" content="IE=Edge") However, there are some things you...

Under certain (unknown) circumstances, Rails will give localized files an invalid content-type in the Response header. For me, after...

github.com

This allows you to e. g. write templates for Backbone views using Haml...

If you want to inspect the compiled code of your erb (or haml) templates, you can run the following code in your view or your controller: template = lookup_context.find_template(action...

ombulabs.com

...bundle exec bumbler [################################################# ] (49/65) travis-lint... Slow requires: 110.21 render_anywhere 147.33 nokogiri 173.83 haml 179.62 sass-rails 205.04 delayed_job_active_record 286.76 rails 289.36 mail 291.98 capistrano...

makandra dev
jashkenas.github.com

Imagine all the syntactical delights of Ruby and Haml for your JavaScript. You write in a nice language, but get normal JavaScript at runtime. All whilst having full access to...

blog.bitcrowd.net

...in production mode. Daniel Zahn made a blogpost about our journey, precompiling assets, fingerprinting, Haml, Sass & Compass and what he calls "the dark heinous hutch...

makandra dev
w3.org

The following Haml will do: %head{ :profile => 'http://www.w3.org/2005/10/profile' } %link{ :href => image_path('favicon.ico'), :rel => 'icon', :type => 'image/vnd.microsoft.icon' } Note that while you can link to icon formats other than...

github.com

Hanna is an RDoc template that scales. It's implemented in Haml, making the sources clean and readable. It's built with simplicity, beauty and ease of browsing in mind...

alert("Hello"); <% end %> to <% javascript_at_bottom do %> alert("Hello"); <% end %> In your Haml views change :javascript alert("Hello") to - at_bottom do :javascript alert("Hello...

...that JS file in your layout only for old IEs. Looks like this in Haml: /[if lt IE 9] = javascript_include_tag 'media_queries_polyfill' Note: Using an IE conditional...

faviconit.com

...sizes, formats and with the HTML needed to include them! In Rails applications with Haml: put all the favicon files into /public store the HTML to app/views/layouts/_favicon.html add = render 'layouts/favicon...