ruby on rails - displaying data from table columns in the view -


i able display information table user submitted data. can't seem setup how display users information table.

index.html.erb:

#this gives undefined local variable or method 'bio'. bio.content works on user page if signed in , shows data user only.  <%= bio.content.all %> 

bio_controller.rb:

            def show             @bio= user.all         end 

user_controller.rb:

  def show     @bio = current_user.bio.build 

can show me missing can show bio information database, instead of being allowed show data of signed in user profile.

you need @bio.content.all in view. , want structure html:

if @bio    @bio.content.all.each |b|       <!-- html show `b` record -->    end end 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -