Hi,
I have a model user.rb, a controller userdata_controller, methods
in the controller and respective .rhtml files. I created a
registration page. Saved into users table and it works fine. But
sometimes its throwing error as
It assumes that there is no field 'city' in table users.
I confused a lot. It is never working until i restart my mongrel. I am
not able to predict, when the problem rises.
Yes,
My table have 'city' column. and i am able to save user data, when
he do registration.This problem occurs on only at particular
scenario.Just now I found a scenario, Which is
1.When i try to go to (action)registration page by clicking the link,
then the registration process works well.
2.When i try to go to same (action)registration page by redirecting
from another action(based on condition whether the user has logged in
or not), then the registration process fails when i do save the user.
Do you see anything in the log file when it gives undefined method
that might give a clue?
What deployment system are you using? Try running webrick and test
there, if the problem doesn't happen, then it's probably something
with your production deployment.
1.When i try to go to (action)registration page by clicking the link,
then the registration process works well.
2.When i try to go to same (action)registration page by redirecting
from another action(based on condition whether the user has logged in
or not), then the registration process fails when i do save the user.
Hmm, that's strange. The only thing I can think of is that the
redirection is setting a session variable or cookie or some other
persistent data that's messing up the process.
my scenarios are this,
1.When i try to go to (action)registration page by clicking the link,
then the registration process works well.
2.When i try to go to same (action)registration page by redirecting
from another action(based on condition whether the user has logged in
or not), then the registration process fails when i do save the user.
If i follow the first scenario, no problem.
If i follow the second scenario, problem rises.
If i follow the first scenario after did the second scenario,
problem rises still.
Looking for your billion dollar answer.
Thanks,
-Sadeesh
my scenarios are this,
1.When i try to go to (action)registration page by clicking the link,
then the registration process works well.
2.When i try to go to same (action)registration page by redirecting
from another action(based on condition whether the user has logged in
or not), then the registration process fails when i do save the user.
start the server and If i follow the first scenario, no problem.
restart the server and If i follow the second scenario, problem
rises.
restart the server and If i follow the first scenario after did the
second scenario,
problem rises still.
Looking for your billion dollar answer.
Thanks,
-Sadeesh
my scenarios are this,
1.When i try to go to (action)registration page by clicking the link,
then the registration process works well.
2.When i try to go to same (action)registration page by redirecting
from another action(based on condition whether the user has logged in
or not), then the registration process fails when i do save the user.
Does it go away if you change cache_classes to true in development.rb?
Hi Frederick,
First of all thanks for your reply.Your answer is great and it
resolved my problem partially for the below one.
-----8<-------
my scenarios are this,
1.When i try to go to (action)registration page by clicking the link,
then the registration process works well.
2.When i try to go to same (action)registration page by redirecting
from another action(based on condition whether the user has logged in
or not), then the registration process fails when i do save the user.
Does it go away if you change cache_classes to true in development.rb?
Fred
------>8--------
Yes, it gets away after I made cache_classes = true in development.rb.
But it has been fixed partially. Now what is the real problem is,
1.If I follow the first scenario as usual no problem and if I continue
the second scenario, it works(because of your suggestion).
2.If I directly do the second scenario, problem rises and If I
continue the first one then also problem rises. I could able to do
nothing then after.
Can you explain me why? looking for your reply Frederick,
Yes, it gets away after I made cache_classes = true in development.rb.
But it has been fixed partially. Now what is the real problem is,
1.If I follow the first scenario as usual no problem and if I continue
the second scenario, it works(because of your suggestion).
2.If I directly do the second scenario, problem rises and If I
continue the first one then also problem rises. I could able to do
nothing then after.
This means you are confusing the dependencies mechanism. This usually
means that either:
- You have got plugins hanging on to references to one of your model
classes or instances of it
- You're explicitly requiring a class (ie using require), which
sidesteps rails' dependency stuff.
Fred,
I am using only one plugin simple_captcha. And I never explicitly
requiring a class in my app.
Now I am in new problem which is I am having model profile.rb and
table named profiles. If I tend to do like below,