Rails article helper – “a” or “an”

None that I know of but it seems simple enough to write a helper for this right? Off the top of my head def indefinite_articlerize(params_word) %w(a e i o u).include?(params_word[0].downcase) ? “an #{params_word}” : “a #{params_word}” end hope that helps edit 1: Also found this thread with a patch that might help you bulletproof this … Read more

“undefined method” when calling helper method from controller in Rails

You cannot call helpers from controllers. Your best bet is to create the method in ApplicationController if it needs to be used in multiple controllers. EDIT: to be clear, I think a lot of the confusion (correct me if I’m wrong) stems from the helper :all call. helper :all really just includes all of your … Read more

(PartialView) The model item passed into the dictionary is of type ‘Customer’, but this dictionary requires a model item of type ‘UserProfile’

Make sure your Model.UserProfile is not null. I found your post trying to debug the same error, and it turned out I hadn’t initialised my “Model.UserProfile” equivalent. I guess what’s happening here, is that if a null model is passed to RenderPartial, it defaults to using the main view’s model? Can anyone confirm this?

How to deal with Mac OS X Helper/Main app architecture regarding core data, shared preferences and notifications?

There isn’t one right answer to this problem, but here’s how I’d approach it: Both the daemon and viewer application uses the same core data store to save and retrieve data. Because sharing a Core Data store between processes isn’t supported (as far as I know), I’d have the daemon expose an XPC Service. Instead … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)