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

Le mercredi 19 juillet 2017 21:45:53 UTC-4, babacar thiam a écrit :
>
> 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.
>
>
> Le mercredi 19 juillet 2017 21:26:01 UTC-4, David Gleba a écrit :
>>
>> 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
>>
>> ###  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>   
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/311c733c-06ca-42f9-b152-85e3ab92d502%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to