Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Metajunkie's Profile

GitHub User: metajunkie

Site: http://metajunkie.mp

Comments by Metajunkie

Avatar

As per their online documentation - Rails 3.2 is not yet supported with version 1.0 - but should be with the next minor release.

Even after installing Rails 3.1.4 I couldn't get the stable version to work. I love everything about rails - except issues that I seem to have regarding versions and dependencies. :( I use rvm - and that seems to be a nightmare when it doesn't work.

Avatar

Any chance of getting this series updated for the Rails 3.x series of frameworks?

I'm having some difficulty translating the routes file in particular. Has anyone used this recently? How did you modify the current_cart line?

I'm trying to build a very simple store for a friend. He is selling one product - and it is a customizable product (different shapes, sizes, and art styles) - but really just one product. So - it didn't make sense for me to use one of the larger e-commerce packages.

It is also nice to know how to roll your own. :) I hope this is updated.

Ken

Avatar

Yes - this happened to me too. It is also happening on older railscasts. I think that may important in solving this little issue. :)

Avatar

I keep pushing this farther. I have the multiple token fields on one page working now.

Now I'm trying to come up with a way to set additional data. For example, when I set a unit token, I also want to set a boolean true. And when I remove the unit - I want to set that boolean to false.

I see there are some callbacks that can be used - but I'm uncertain how I can impact my database from there.

Anyone do this sort of thing?

Avatar

even though you posted this 2 years ago - you just helped me in a big way. I did the same thing. However - the first thing I looked at was: http://apidock.com/rails/Rails/Generator/Spec/klass
I was getting worried that klass was no longer available in the way it was being used. I thought it was going to be a very long night! :P But - it turned out to be a very easy fix - thanks to you! CHEERS!

Avatar

I don't see how that will work with multiple token input fields on one page. They will all be loading the same .json data.

Avatar

has anyone gotten this to work with multiple fields that each need to pull on their own .json?

I have three fields that I'm trying to use this with: streets, buildings, and units.

Avatar

Ryan,

Thanks for this very cool railscast.

If you re-do this railscast, you could re-do it with coffeescript, but also - it would be great if you could show how to implement this with multiple fields in a form using it. Or perhaps there is a better way than using token-input now?

To add to the token-input complexity - you could require three different propertyToSearch items. For example one could use the default "name", but the other two should require something different. In the project I'm working on, I'm trying to use this to populate a work order form, which can have "streets", "buildings", and "units" added to them. Streets have names, but buildings and units have numbers and unit_codes to designate them.

I have seen others modify the javascript to handle multiple fields, where all the options were the same - but I haven't been able to find a solution for what I'm trying to do. I suspect I may be able to declare separate token-input DOM objects... but I"m not sure how to do that yet.

When I tried to just duplicate the javascript for each of my fields - I suspect they stepped all over each other.

Avatar

yes - coffee script is whitespace sensitive

Avatar

I too would like to see this with a many-to-many. I have the token-input solution working with one text field entry - but when I try to use multiples, it breaks. I would like to find a solution that has multiple fields doing this sort of thing. I'm sure this is a javacript/jquery deficiency on my part.

Avatar

Finally got this working with rails 3.1! It took some puzzle skills. The last part I was having an issue with was that the search wasn't noticing the first letter. It turned out to be a case sensitivity issue, and using ilike rather than like, solved the problem.

Thanks for posting your solution pulp! I was beating my head against the wall! I'm using PostgreSQL locally - in case that helps anyone else.