Git Product home page Git Product logo

sales's People

Contributors

akkdio avatar

Watchers

 avatar  avatar

sales's Issues

cannot get the book test to run have a UrlGenerationError

The test on page 30 does not work for me. I get this error:

ActionController::UrlGenerationError: No route matches {:email=>"[email protected]", :stripeToken=>"tok_123456", :controller=>"payments", :action=>"create"}

Looking at the rails guides I find that the source of the error may be an id is not being set:

 when "/missing_keys"
    raise ActionController::UrlGenerationError, "No route matches"

however, I tried a variety of ways to isolate this to find the keys that were missing but am lost. So I will punt for now.

page 48

The js should read like this:

 <script type="text/javascript">
 $(function(){
Stripe.setPublishableKey('<%=Rails.configuration.stripe[:publishable_key]%>');
 });


   $('#payment-form').submit(function(event) {
   var form = $(this);
   form.find('button').prop('disabled', true);
   Stripe.createToken(form, stripeResponseHandler);
   return false;
   });

   </script>

The book has $(function({... which leaves out a ")"

AASM causing errors

Trying the AASM gem from the book on page 57 and having issues getting the charge_card method to fire. This is my initial thought since the errors coming back (see below) are saying complaining about not having and attribute. I have not been through the code line by line with a fine tooth comb to see if there is typo somewhere but I have commented out the attribute calls in the sales create method and it seems that the call to stripe.charge is not happening. Here is the error with this :

ActiveRecord::UnknownAttributeError in PaymentsController#create

unknown attribute: amount

Incidently the app lives on heroku:
https://morning-earth-2357.herokuapp.com

But it has these issues and more since I am not strictly adhering to the book. Partly because the book has errors and partly because it lacks a complete code list and is only given in snippets and that is bad news bears for the noobs.

page 23:

This route here:

 get '/pickup/:guid', to: 'transactions#show', as: :pickup

should be:

get '/pickup/:guid', to: 'transactions#pickup', as: :pickup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.