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 wil
On Oct 15, 2010, at 10:15 AM, dbkbali wrote:
From your extensive knowledge would there be any design or performance
advantage in refactoring so that the browser requests a pure html
partial only?
I am guessing here what Marnen's intention was, but I believe he was
saying that the browser sh
On Oct 15, 3:43 am, radhames brito wrote:
> > I mean that you're apparently using it as a repeated pattern. I think
> > it's an antipattern -- something that looks like a good design pattern
> > at first, but is in fact to be avoided.
>
Marnen,
As someone who is a relative rails newbie, and wh
> No, absolutely not. I am saying that dynamically generating JS by means
> of ERb is a design problem. Receiving a partial from an Ajax call is
> fine.
>
>
I would really like to see an example of how to pull a partial with ajax
without js.erb or js.haml, in a easy way of course, note that if he
pepe wrote in post #950138:
>> Anyway, any solution requiring js.erb is, almost by definition, "doing
>> it all wrong". js.erb should never be necessary in a well-written
>> project: you shouldn't be dynamically generating source code.
>
> What do you mean by "dynamically generating source code" he
> Anyway, any solution requiring js.erb is, almost by definition, "doing
> it all wrong". js.erb should never be necessary in a well-written
> project: you shouldn't be dynamically generating source code.
What do you mean by "dynamically generating source code" here? Are you
saying that going for
> The only interaction I want is from javascript to Rails. While the
> params does seem to be grabbing the query string, it is always returning
> the "-" in front.
>
Oh then you are doing it all wrong, you should be usign a getScript and let
rails return a js.erb file that uses a partial to redraw
Radhames Brito wrote in post #949717:
> params is not a function is a hash, hashes are unordered key value pair
> in
> ruby, the key are symbols. The hash is assembled by rails from the query
> string or from serialized data( i think :S) like a form.
>
> If you want to pass data to java script use
8 matches
Mail list logo