ruby on rails - How to add a user's email to a list when a button is clicked -


i new rails, sorry if pretty obvious. want users click button (i'm using devise), , when pressed, email added onto list. also, want counter shows how many people have signed up. how do this?

i don't know list looks but

to contain user's email, add email column on user model or something. http://guides.rubyonrails.org/active_record_migrations.html

class addemailtousers < activerecord::migration   def change     add_column :users, :email, :string   end end 

to show how many people have signed up, use class method.

user.count(:email)  

it unclear question honestly, if understanding correct.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -