Tag: rails


Custom Google Maps Marker With YM4R_GM

In one my Rails applications, I allow the user to search for surrounding businesses from their current location. I always showed them a You Are Here marker. The issue I had with this was that the marker was always the icon as the search results. Differentiating these markers is actually extremely easy with ym4r_gm plugin. …

By eric

Country-State Select Using Carmen and jQuery

I’ve been wanting to find a way to use drop down menus for countries and their states when they exist. But keeping a list on my own would have been a huge pain in the ass. So rather reinvent the wheel, I found the Carmen plugin for Rails. All I have to do is keep …

By eric

Adding AJAX Bookmarks to Your Rails Application (Part 2 of 2)

In part 1 of this series, we discussed the base models, controller, database migrations necessary to get this project off the ground. Now we are going to continue with this functionality Let’s take a look at what needs to go into the models to support this. If you have a model that uses a slug …

By eric

Adding AJAX Bookmarks to Your Rails Application (Part 1 of 2)

It you want to add the ability to bookmark pages in your Rails application, its actually a fairly straightforward thing to do. You can even do them in AJAX. There may be better ways to do this, but this way is somewhat abstract and it works for me, so hopefully it can work for you …

By eric

One Time Modal Windows With Rails and Fancybox

Let’s say that you have a situation that you want to have a modal window show up only once for each user. It’s actually not that difficult although lots of Googling around got me nowhere. I am choosing to use FancyBox for my modal window, but feel free to use your modal framework of choice. …

By eric

Migrations Without belongs_to Or references

Normally when do a database migration in Rails, when adding ownership from a model to another model, you use the concept of belongs_to or references: 1234  create_table :comments do |t|     t.belongs_to :user     t.references :post   end Interestingly enough, these methods are only available during the initial table creation. If you want …

By eric

Shortcut Notation in Rails Callbacks

As I have spent the last few weeks/months learning Ruby and Rails, I have grown to love it more and more. The ease of use and the high learning curve make is fantastic for people like me who aren’t developers by nature. I have recently come across a scenario in Rails that there is not …

By eric

Adding An Average Column To A Model

Using Ruby on Rails is all about what people find to be common uses. These items then become part of the core system. An example of this is counter_cache. For more information on this, I suggest checking out the Railscast on it here. A little more of an edge case is if you want a …

By eric

Checking Roles in Views Using RoleRequirement

One of the rails projects I am working on is using the RoleRequirement plugin. This is a great plugin for seamless integration of roles into the controller level, but there wasn’t really much documentation on integrating this into the views themselves. So I figured I would put this little gem out there which has done …

By eric

Testing Sessions with Digest::SHA256 Passwords In Rails

I am fairly new to Rails, but from what I have learned thus far, its fantastic. I plan on posting more obscure Rails items as I come across them. I am writing an application that is similar in functionality to Yelp (in some ways). I have had some help along the way from a seasoned …

By eric

Follow My Travels

Buy My Book

Archives

  • 2020
  • 2019
  • 2017
  • 2014
  • 2013
  • 2012
  • 2011
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006

New Posts By Email

writing