Quantcast
Channel: Notes posted by newdark
Browsing latest articles
Browse All 6 View Live

Recommendations (ActionView::Helpers::AssetTagHelper#image_path)

I would just use the path_to_image. I find that this is what works best. As it says above it can create problems.Here is my codeCode example def...

View Article



Usage (Array#join)

I use this in views when I need to join a array of objects from a sql request here is a basic version of what I mean.Code example <%= @blogs.map{ |blog| blog.comment }.join(“ | ”) %>

View Article

Clarification with use of update_all (ActiveRecord::Base#update_all)

I would like to point out that if you are on rails 2.3.11 or lower you will not be able to run ledermann code.Ledermann Codeuser.messages.update_all(:read=>true)If you are running 2.3 or later it...

View Article

Found out you can't set the type to number...

I am sure others have tried to do this but I thought I would add a not that tells ever one. You can’t use the type field in in rails 2.3. It is always set back to type => “text”So if you are trying...

View Article

Alternitive to to add flash to respond with...

This is a nice way to add flash if you don’t have a any logic that needs to go around your flash.def...

View Article


Sort Integers (Array#sort!)

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]Sort From Greatest to Smallest>>[1,2,3,4].sort{|a,z|z<=>a}=>[4,3,2,1]

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images