1:
So, are you saying you have succeeded with: 'i see the problem was solved. In a simple example if i add user or item or role at the seed.rb file it run normally and me i need to add user or item in the html.erb file? ’
2:
It is your choice. Devise/cancancan or strongbolt.
I have not looked at strongbolt.
I am having good results with Devise/cancancan.
I say that i have a mistake if i want to create new user or new role or new item in the html.erb.
And if i use seed.rb i succeeded.
-
Devise/cancancan i think that its interesting so i look for other alternative for cancancan.
Yeah its my blem to create this.
Cause for me i have a view user and if i want to creer or edit new view i havent role my collection select is empty.
MAy i import your view user2 for me ?
Do this in your project folder at command prompt.
rails generate scaffold User2 email:string encrypted_password:string reset_password_token:string reset_password_sent_at:datetime remember_created_at:datetime sign_in_count:integer current_sign_in_at:datetime last_sign_in_at:datetime current_sign_in_ip:string last_sign_in_ip:string confirmation_token:string confirmed_at:datetime confirmation_sent_at:datetime unconfirmed_email:string failed_attempts:integer unlock_token:string locked_at:datetime name:string role:references --no-migration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
add new lines of text after patrn…
filetarg=‘app/models/user2.rb’
r1tmp=“/tmp/temprubyrunner${USER}.rb”
cat << ‘HEREDOC’ > $r1tmp
repl2 = %Q{
self.table_name = ‘users’
}
ARGF.each do |line|
puts line
puts repl2 if line =~ /ApplicationRecord/
end
HEREDOC
ruby $r1tmp $filetarg > $filetarg.tmp
cp $filetarg.tmp $filetarg; rm $filetarg.tmp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yeah i see and then if i wan t to load data at item html.erb i have a problem for my user id because i have a link to user and item in item table.
Hi in my item view i want to know how to add item using the user id who connected in my app i doo link user to item
hi all i want to solve my problem i need to download a minimal projet and if i bundle them i have a mistake saying.
