RailsCasts Pro episodes are now free!

Learn more or hide this

Dmytrii Nagirniak's Profile

GitHub User: dnagir

Site: http://ApproachE.com

Comments by Dmytrii Nagirniak

Avatar

Tempting for me to point out the allowy gem.

The implementation is very similar to what has been shown in this screencast.
Very lightweight, inspired by CanCan.

Even though it doesn't have much activity it is being used in production heavily (so sometimes project can be "finished" :) )

Avatar

Thanks Ryan for the episode.

If you will be covering KnockoutJS (which is currently my preference after evaluating most of the frameworks) then you may want to take a look at knockout-rails gem.

Simple screencast that demos validations part of it:
http://blog.approache.com/2011/12/knockoutjs-validations-video.html

(it went into Ruby5, so seems like people liked it).

Cheers.

Avatar

I also wonder how you would reuse the template with Rails 3.1 assets pipeline and JST?

Avatar

Another thing is that I would probably use Spine.js or similar for infinite scrolling: http://vimeo.com/30796067

Avatar

Assets Pipeline has nothing to do with including the scripts.
you can use config.assets.precompile to configure which assets will be generated. But that's about it.

If you want to include the script into /admin pages just use normal javascript_include_tag('admin/your-file.js').

Avatar

For me in the development it is not that slow.
Although during JS unit testing it is. But it is solved by guard-rails-assets.

Avatar

1) You have to reference those files appropriately as someFil.js and subfolder/someFile.js. There is no collision.

2) Every file is only included once - the first time it is required implicitly or explicitly.

Avatar

Found - I needed to add require 'sprockets/railtie' to dummy application.rb (when not reqruing the whole rails).

Then assets can be accessed via Rails.application.assets.

Avatar

I wonder how can I access the assets data in a test?

I tried Dummy::Application.config.assets['application.js'] but it always returns nil for all the assets.

Probably I should initialise it somehow...

Avatar

Thanks Ryan.
Just curious how would you test the search and/or fake it for other tests?

Avatar

I was wondering how do you use very handy webrat view and controller marchers as those are conflicting with capybara?
I decided that webrat marchers are more important for my workflow and had to get rid of capybara.

What is your take on that?

Cheers,
Dmytrii.

Avatar

BTW, I just created the CoffeeScript syntax highliter for highlight.js https://github.com/dnagir/highlightjs-coffeescript

A bit different tool, but might help others I guess.

Avatar

Ryan, I agree with you.

I used to use Devise. But then I realised I spend way more time trying to customise it than just implementing it from scratch.

This is especially true when you need to do something that Devise doesn't support "out of the box".

Avatar

I am wondering how Compass framework will stack up with the new SASS.

The most handy thing about compass I use now is:
compass .

which compiles all the SCSS files and places them under public/stylesheets