ruby on rails - Creating User Profiles -


pretty new rails, , coding in general. i'm working on own app right now, in i'm trying create user profiles. know there have been few questions this, i'm trying is...

upon authentication (which i've set using devise), user redirected his/her profile page he/she can set own profile, fields similar may find on social networking website.

i'm running rails 4.1 , ruby 2.1 right now. have suggestions on best way go doing this. mentioned i'm new rails, , have spent last few days furiously searching advice on internet.

does know of step step guide?

i suppose need guidance on start.

thanks!

recently created user profile user can add/edit personal details,see has uploaded.what has liked,posted , edit/delete/update has created/uploaded.so in user profile need fetch details/associated models of user , show.so u have devise..you can current_user , use user.rb model understand associations of user , data using associations ans display on profile page

i have created profile_controller in nav_bar have link_to <% link_to "view profile",show_profile_path(current_user) %>

where user directed profiles controller , show details without creating new model(user has_one :profile)

i have dedicated page show profile details + small page show user profile when hovered on users image

take here view side idea... user profile page on bootstrap 3

=======updated part===========

suppose have user.rb(using devise)

###different associations of user can be:=  ##this user can like/dislike model having acts_as_votable acts_as_voter ##user can tags post/audio/videos/images acts_as_tagger ##my user can create post,pages,upload images/videos/songs/locations etc... has_many :posts, :class_name => 'post', :dependent => :destroy has_many :pages, :class_name => 'page', :dependent => :destroy has_many :images, :class_name => 'image', :dependent => :destroy has_many :videos, :class_name => 'video', :dependent => :destroy has_many :audios, :class_name => 'audio', :dependent => :destroy has_many :places, :class_name => 'place', :dependent => :destroy has_many :profile_pictures, :class_name => 'profilepicture', :dependent => :destroy   #####so..as know **my user can have post/pages/audios/videos** etc...i can details associations(assuming have configured belongs_to in associated models + tables foreign_key user_id in eash associtated table),such as:-*  ##to  videos user has uploaded @user.videos ##same applies other associated models @user.images..@user.audios...@user.pages.....@user.post....@user.places...@user.profile_pictures...etc ####so have user(current_user data)... ###its time show data in profiles_controller.. ##your show method ## profile#show def show @user=user.find current_user.id @all_user_videos=@user.videos..and on ##get user videos/images..etc , show in view file ##your view file can 1 shared link or other way want... ###there lot of ways...google around , can idea how display user_profile page..as have data(*yipee*)  end##method ends 

hope helps


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -