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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/c04de17a-4b25-4899-9f83-3419f1a9d5f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.