Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Nik's Profile

GitHub User: niksosf

Comments by Nik

Avatar

Does anyone know if Mongoid can be used instead of activerecord?

Avatar

I find this to be the most effective way for entering date and time. EVER
http://keith-wood.name/datetimeEntry.html

I tried these other solutions as well but none is as natural and efficient when you have to pick 100+ of dates and times:

I call this, Normalized units calendar
http://www.ama3.com/anytime/#AnyTime.picker.placement

iPhone Style
http://demo.mobiscroll.com/#demo=datetime&theme=default&display=modal&mode=mixed

Windows System Tray Like
http://www.eyecon.ro/datepicker/

an O.K. one
http://stefangabos.ro/jquery/zebra-datepicker/

TimePicker
https://github.com/fgelinas/timepicker

https://github.com/ChiperSoft/Kalendae

Hope these help

Avatar

I have one question about the class variable that is preceded by @@, I know that the Web is stateless and everytime a request comes to a server it is as if it's the first time they meet each other. since I don't see any database in the example, the @@counter must be incremented 5 times to get to the number 5, but if it loses its state in each request, how does it ever get up to 5? does that repeat 5 command tell the connection to stay alive for another request? or is that & at the end of the curl command doing this? I hope I am making sense here...

Avatar

Just got myself two certificates on GoDaddy for $12.99 each; just wherever you get yours, first search on sites like RetailMeNot.com for coupons and stuff. Those godaddy certs were a whopping $70 a year before the coupons.

Avatar

+1 with awesome_nested_fields. It's got very detailed wiki

Avatar

I am using the mongoid data table gem that has a one stop search functionality https://github.com/potatosalad/mongoid-data_table

Avatar

Yeah, I was thinking about the delay in loading different elements. So I am guessing the benefit of caching outweighs the milisecond-ugliness for mostly the admin, like the edit/destroy buttons, headers or anything else, I suppose admins can tolerate that. But if it does happen on the client facing elements, I guess a one can do a complete $('#container').show() preceded by #container{display:none} css with an "Loading" HTML message. That way, it looks a bit more professional and certainly is going to be lighter for the server still (just serving HTML files like the 90's)

Avatar

Hi Federico, I am interpreting your concern in two different ways. One, in plain words, is that you are concerned people can do admin stuff simply by turning off CSS. Correct me if I am ignorant that you actually already know that's not possible IF you do something like before_filter authorize_user! with Devise in your controllers. - Which brings me to a second possible interpretation of your concern: you simply are talking about that there is one more scenario where people might SEE the Edit/Destroy links, a purely interface concern, not one of security. I mean, MOST people don't disable their CSS, so the small bunch that happen to, you can NOT render the Edit links and send a javascript request to check for Admin, then return a evaluated template to each place needing these links and grab the proper ID as you loop along doing template inserting. That way, it's definitely not a problem if they do $('*:hidden').toggle(). But then again, if you don't have CSS turned on, you might also have Javascript turned off as well. And in that case, I guess you might have to resort to some trickier routing conditions and serve two different html files?

Avatar

I am new to Mac but I noticed that you don't need zsh to have the feature that whenever you open a new tab in the terminal, it will land in the same directory from which you make the new tab. Does anyone else also get that?

Avatar

Hi there, Ryan says in the video that we should gitignore the stripe api key initializer file so to avoid it being divulge in general development. But when the time comes that we do need to push it to the production server, like Heroku which I use, how do you go about it? do you do something with git add just for that one push?

Avatar

Hi there, I am still rather new to programming. I at around 4:50 where Ryan says something about you can either have the orderpdf class inherit from prawn::document or something about delegating? I know it may be too long to explain here, but does anyone know of a good place to start looking? I don't know even what keyword to search on google about this..

Thank you!

Avatar

Does anyone know how to make sure the images loaded by jQueryUI library CSS are correctly referenced in the production?

I know from the one of the comments that you can use image-url('some_pic.jpg'); but that's simpler when you have written the code yourself, when you drop in a library from somewhere else, you have to hunt them all down the first time you use it and each time you upgrade it, that sounds real bad to me.

I am guessing this is a non-solvable problem at the moment. Because if it is solvable by some clever plugin, then what's the point of correcting all the url('dir1/dir2/image.jpg') to image-url('image.jpg')? But then including an external library that has images is not at all uncommon, I would think that the Rails team would have thought about it...

Avatar

Couldn't be more getting Pry right away: am running win764 bit, for some reason, I never can get color highlighting to work ANYWHERE; not even with a freshly installed system following every guide to the dot. If anyone here knows, please please enlighten.

Avatar

Hi, I am using Mongoid as database, does anyone know if it is safe to use regular expression matching for a string field in that self.search method for individual users?

like current_user.projects.where(:name => /#{params[:search]}/i)

Thank you