Foliwe Fossung

Joined

110 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Create a User Profile after saving a Devise User

how would you create an edit page with a form to edit the user profile

it's really hard getting respond here 

Hi @Chris i have this error and i don't know why . i have a project model instead of a post model
When i visit the root_path i have this error
undefined method `projects' for nil:NilClass

project controller
  def index
    @projects = @account.projects.all 
  end
.....  def set_project
      @project = @account.projects.find(params[:id])
    end
....
help neeed

Posted in Stripe Elements Javascript Discussion

 hi Chris ,i followed the tutorial but only the stripe_id and customer_id are saved in the user database , the card infos are all nil i help need.  i am using stripe element
UPDATE "users" SET "stripe_id" = ?, "stripe_subscription_id" = ?, "updated_at" = ? WHERE "users"."id" = ?  [["stripe_id", "cus_Cx4IDGQ7HlS7DY"], ["stripe_subscription_id", "sub_Cx4IrtnieqN82q"], ["updated_at", "2018-05-29 15:54:32.368665"], ["id", 1]]
as you can see not card info is saved

put the logs show the card info in the params
Started POST "/subscription" for 127.0.0.1 at 2018-05-29 16:54:25 +0100
Processing by SubscriptionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"aZgXCURZ/mVziIEGuRAdJ+oI9RrX44IY4rYwhH2t4AieyfNk/fg==", "stripeToken"=>"tok_1yxdg........wxcu", "user"=>{"card_brand"=>"Visa", "card_exp_month"=>"4", "card_exp_year"=>"2024", "card_last4"=>"4242"}}
 help needed

subscription_controller.rb
def create
customer = if current_user.stripe_id?
Stripe::Customer.retrieve(current_user.stripe_id)
else
customer = Stripe::Customer.create(
email: current_user.email
)
end
subscription=customer.subscriptions.create(
source: params[:stripeToken],
plan: 1,)
current_user.update(
stripe_id:customer.id,
stripe_subscription_id:subscription.id,
card_last4: params[:card_last4],
card_exp_month: params[:card_exp_month],
card_type: params[:card_brand],
card_exp_year: params[:card_exp_year]
   )
  redirect_to root_path
end</pre>

Posted in File Uploads with Refile Discussion

please can you make a deployment to heroku with aws video with refile gem

Posted in File Uploads with Refile Discussion

please can you make a deployment to heroku with aws video with refile gem

Posted in Admin Interfaces with Administrate - GoRails

How to add a new model to administrate dashboard ?

Posted in Admin Interfaces with Administrate - GoRails

it seems this gem has been updated. because following this tut, nothing works. the route file is
Rails.application.routes.draw do
namespace :admin do
resources :users
resources :articles

root to: "users#index"
end
i see no dashboard manifest files. Somethings have change. localhost:3000/admin results to errors

Posted in User Authentication with Devise | GoRails

am trying to set up a simple blog with devise.How can i restrict users from editing the profiles of other users. so mush so that if the try something users/edit.3, there will be redirected to somewhere with flash message. Thanks

Posted in Sending Emails with SMTP and Sendgrid Discussion

can we use mailer to send message like in a web contact form without saving the message into the database?

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.