class User < ActiveRecord::Base
is this written in your model?
class User < ActiveRecord::Base
is this written in your model?
Hi tell me how you know its not getting saved did you checked db.
refresh it and check . Here maybe
“if” statement is not working
Ruchita S. wrote:
Abhi M. wrote:
class User < ActiveRecord::Base
is this written in your model?
Model is:
class User < ActiveRecord::Base
belongs_to :role
belongs_to :designation
belongs_to :country
belongs_to :state
end
Any other association that needs to be made?
Abhi M. wrote:
class User < ActiveRecord::Base
is this written in your model?
Model is:
class User < ActiveRecord::Base
belongs_to :role
belongs_to :designation
belongs_to :country
belongs_to :state
end
Hi
please give a breakpoint @user before @user.save
and please close the db if its open
let me know if values are there
Abhi M. wrote:
let me know if values are there
Hi Abhi M.,
Its not responding. I had given a breakpoint before @user.save and its
not responding.
Abhi M. wrote:
Try removing
@user = User.new from action new_client and replace
@user = User.new(params[:user]) by @user = User.newStill not working. Again the control is not going after if @user.save.
What should be done?
Try @user.save! instead of @user.save and check log/development.log what
error is thrown…
Alternative method: run script/console and simulate the user creation
via command line (remember to save user with this method user.save! !!!)
Good luck !
Tex.
So validation was the problem ?
I am very happy for you Ruchita.Past 4-5 days I had a good experience in
ror because of you, So thank you. And today I think I felt atleast 10 %
of your pressure and tension. Felt Good to work with you
Hope that you will keep in touch my mail id is [email protected]
Thannks and All the Best
Gianluca T. wrote:
Abhi M. wrote:
Try removing
@user = User.new from action new_client and replace
@user = User.new(params[:user]) by @user = User.newStill not working. Again the control is not going after if @user.save.
What should be done?Try @user.save! instead of @user.save and check log/development.log what
error is thrown…Alternative method: run script/console and simulate the user creation
via command line (remember to save user with this method user.save! !!!)Good luck !
Tex.
Hi Abhi M.,
Its working now. I have commented all the validations in user’s model
and now its working. Thanks a lot for your help. Thank you so much.
-Ruchita S…
Abhi M. wrote:
So validation was the problem ?
I am very happy for you Ruchita.Past 4-5 days I had a good experience in
ror because of you, So thank you. And today I think I felt atleast 10 %
of your pressure and tension. Felt Good to work with youHope that you will keep in touch my mail id is [email protected]
Thannks and All the Best
Hi Abhimanyu,
Thanks a lot for your help and support. Yeah sure i will definitely be
in touch with you.
Thanks again and All the Best to you too.
Hi Abhimanyu,
I am implementing the functionality where I have three tables one is
users table, second is groups table, and the third is users_groups
table. This is the join table of users and groups where i have user_id
and group_id. In users group i have a field type_id which identifies the
type of user. Now by using these three tables I have to show the users
whose type is resources and they belong to a particular group. Please
suggest me the way of implementing this functionality.
Thanks,
Ruchita
I’ve been following this thread for days and was hoping someone might
share a simple ‘boiler-plate’ example for us ‘bottom-feeders’ to
utilize.
This example of country - zipcode has many applications and I’d love
to integrate it into my code.
If anyone has an example of this working, I’d be very grateful to view
it.
Thanks,
Kathleen
[email protected]
On Oct 28, 11:03 pm, Abhi M. [email protected]
Hi Ruchita
Let me tell you what I understood
You have users table having fields id,…
groups table having field id,…
and usergroup table having fileds user_id, groups_id,usertype_id
Is that correct?
Hi Ruchita,
Ok If you have time try with observe field. I havent tried in it
that much yet. Its good if you try other options if you have time, as
you can study those
Abhi M. wrote:
Hi Ruchita
Let me tell you what I understood
You have users table having fields id,…
groups table having field id,…
and usergroup table having fileds user_id, groups_id,usertype_idIs that correct?
Hi Abhimanyu,
I need to implement a drop down for types of users. If type of user is
resource only then the second drop down needs to be filled with the
types of groups. I have implemented it with javascript but again the
same problem, and am not able to implement it with Ajax.
The fields of users table have type_id but the resource table don’t have
any type_id field so i am doing it by passing the id as 3 coz in types
table the users whose type is resouces hav id 3. Please tell me how to
implement it with Ajax. Shall i use observe field.
Abhi M. wrote:
Hi Ruchita,
Ok If you have time try with observe field. I havent tried in it
that much yet. Its good if you try other options if you have time, as
you can study those
Okie… let me try. I’ll let you know. Are you working in RoR?
Abhi M. wrote:
yes and you?
Yes me too
Hi
Other thing is over? .Is this ur new project. r u working in India?
yes and you?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs