David Hamilton was right. This was a javascript issue, not a Ruby issue.
This worked:
var order_value1 = (order_value.indexOf("-") > -1) ?
order_value.substring(1) : "-" + order_value;
Now regarding what's the intentions here. If you look at the full
javascrpt I posted in stackoverflow, you will see that when someone
clicks a link, I basically check the link href attribute in order to
determine which list to populate. So if it's posts, it will populate the
posts page with records from the posts table in the database. Now when
that initializeTable method is called, it instantiates a Form and Table
object. These objects inherit certain properties, so when a user
interacts with their subelements, such as dropdown, input field, links,
it will call the list object's methods in order to filter, search, sort,
etc the table. Now the idea is that the lists object just returns a
bunch of hashes (key/value pairs) that get appended to query string so
that the params hash in Rails can catch it and send it to the model to
perform sql. At least that's what I am hoping to accomplish here. I am
not trying to use any plugins at all. I am trying to do this purely in
javascript (using jquery library but no jquery plugins) and in rails.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.