I have been seeingthis problem lots and I guess I must always work
around it without understand why it’s there, so maybe you all can help
me. I have this form:
which checks the validation of a credit card number, adds it to the list
if all is good, or pops up an error box if it is not. When it is not
valid, the error box comes up but then in the field that I am updating i
get:
Template is missing
Missing template
./script/…/config/…/app/views/enroll/add_credit_card.rhtml
Now, I understand it is going and executing the code in the
‘add_credit_card’ method, but there is no 'add_credit_card.rhtml," there
isn’t meant to be. I simple want it so that if the validation fails,
nothing happens after the user hit ‘OK’ on the pop-up box.
So I guess my question is, can someone explain why this is happening,
and how to fix it? Thx,
valid, the error box comes up but then in the field that I am updating i
nothing happens after the user hit ‘OK’ on the pop-up box.
So I guess my question is, can someone explain why this is happening,
and how to fix it? Thx,
When you call a Rails action it needs to return something. By default it
tries to return a rendering of the corresponding template. If you don’t
have a template you will need to return something else. Typically you
will use the “render” method for this. Check the API for details.
I have been seeingthis problem lots and I guess I must always work
around it without understand why it’s there, so maybe you all can help
me. I have this form:
which checks the validation of a credit card number, adds it to the list
if all is good, or pops up an error box if it is not. When it is not
valid, the error box comes up but then in the field that I am updating i
get:
Template is missing
Missing template
./script/…/config/…/app/views/enroll/add_credit_card.rhtml
Now, I understand it is going and executing the code in the
‘add_credit_card’ method, but there is no 'add_credit_card.rhtml," there
isn’t meant to be. I simple want it so that if the validation fails,
nothing happens after the user hit ‘OK’ on the pop-up box.
So I guess my question is, can someone explain why this is happening,
and how to fix it? Thx,
~S
Further to Jacob’s reply:
You will want to add something like:
render :action => “form”
to your add_credit_card action.
I’m trying to accomplish the same thing. Have you ever found a
workaround for this?
Shandy N. wrote:
I have been seeingthis problem lots and I guess I must always work
around it without understand why it’s there, so maybe you all can help
me. I have this form:
which checks the validation of a credit card number, adds it to the list
if all is good, or pops up an error box if it is not. When it is not
valid, the error box comes up but then in the field that I am updating i
get:
Template is missing
Missing template
./script/…/config/…/app/views/enroll/add_credit_card.rhtml
Now, I understand it is going and executing the code in the
‘add_credit_card’ method, but there is no 'add_credit_card.rhtml," there
isn’t meant to be. I simple want it so that if the validation fails,
nothing happens after the user hit ‘OK’ on the pop-up box.
So I guess my question is, can someone explain why this is happening,
and how to fix it? Thx,
render :nothing=>true does just what it advertises…it renders
nothing. If you’ve combined that with an :update=>‘my_page’ then you
will blank out your page. Shandy had indicated that she did not want
to render any results; she was only interested in handling a failure.
It appears that your situation may be different. If you provide more
details I might be able to help.
AndyV
On Feb 20, 3:51 pm, Selim Hendrickson <rails-mailing-l…@andreas-
And for the record Shandy is a he. No hard feelings, I get that alot. A
strange name is what you get when you have hippie parents I guess. Could
be worse. Good luck,
~S
My apologies… My last name sounds like a female first name and I
occasionally get the same thing.
which checks the validation of a credit card number, adds it to the list
if all is good, or pops up an error box if it is not. When it is not
valid, the error box comes up but then in the field that I am updating i
get:
Template is missing
Missing template
./script/…/config/…/app/views/enroll/add_credit_card.rhtml
I’m not sure if this is going to help, but what I ended up doing is have
a switch - true if the credit cards was added to the list and false if
it was not. Then, in my partial I have a bit of codes that say if
!@valid popup an alert box, but either way, the list of credit cards
gets redisplayed.
And for the record Shandy is a he. No hard feelings, I get that alot. A
strange name is what you get when you have hippie parents I guess. Could
be worse. Good luck,
~S
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.