Giter Club home page Giter Club logo

awdwr's People

Contributors

davetron5000 avatar prathamesh-sonpatki avatar rafaelfranca avatar rubys avatar vipulnsward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awdwr's Issues

ActionCable vs number_to_currency

I'm looking for ideas.

Agile Web Development with Rails is written with a "look at how easy it is to get started" point of view. And that's how I would like to approach Action Cable. From an Action Cable perspective, it is easy: Define a channel. Broadcast a message. Receive the message. Done.

Easy peasy.

Now the simplest scenario that this could be applied to is updating the price of something while it is being displayed:

http://intertwingly.net/projects/AWDwR4/checkdepot/section-11.6.html

Note that there are two additional steps.

The first is reasonable. After you receive a message, you want to update the DOM. And that means that you need to find the right place in the DOM to update. Which requires the view to be updated. Fair enough.

Once you found the element, you want to replace the text. As the text that is already there is formatted as currency, you want to replace it with the same thing. And that formatting is done on the server.

By default, helper methods, like number_to_currency, are not available to controllers. One way to fix it is to add an include, which is what I'm currently doing, but it feels wrong.

Another way is to create a jbuilder view, perhaps something like this:

json.id @product.id
json.price number_to_currency(@product.price)

This view can be rendered using render_to_string, but then you have a string and ActionCable.server.broadcast wants a Hash (that's not entirely true, it can take a string, but it will JSON encode that string).

This can be compensated for using either eval on the server or JSON.parse on the client, but that doesn't feel any more satisfying than include ActionView::Helpers::NumberHelper.

Replace http with https

The repository has links that can be updated with https.
Would a PR be acceptable for this.
Thoughts?

Outdated dashboard

As per the Releasing Rails guide of rails, it needs to pass the tests maintained in this repository to be released.

Do not release with Red AWDwR tests.

rails also makes the following statement.

You can check the status of these tests here:
https://intertwingly.net/projects/dashboard.html

Though this repository states that these are sample output. and statement above by rails makes one wonder if its the whole output, still the dashboard appears outdated.

I'm unaware of the storage of the test reports, but i see some here, so in case this is the right place, reports of rails 6 does not seems to be available for AWDwR4 there.

Just curious about whether rails has stopped making you happy.

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.