GithubHelp home page GithubHelp logo

Comments (12)

jtrim avatar jtrim commented on June 20, 2024

It looks like this would be extremely easy to add. Any interest?

from js-routes.

le0pard avatar le0pard commented on June 20, 2024

And why is that? js routes comfortable that they have the same name as the ruby :)

from js-routes.

jtrim avatar jtrim commented on June 20, 2024

To solve the problem of case mismatch. If the standard / accepted case in the JS community is lower camel case, simply because something originates from a ruby source doesn't necessarily mean that it should retain the ruby standard case. Put a different way, if there was some piece of code that originated from javascript and was used in ruby, would you be at all put off by having to use camel case in a ruby file?

from js-routes.

le0pard avatar le0pard commented on June 20, 2024

So when data come from Rails/Ruby API in JSON format, do you also convert each key in camel-case?

from js-routes.

jtrim avatar jtrim commented on June 20, 2024

I have never done this myself, but it's not for lack of wanting the feature. I just haven't taken the time to search for a library that does this or patch rails for allowing it. If rails provided this feature out of the box, I'd use it.

from js-routes.

bogdan avatar bogdan commented on June 20, 2024

I would say that I am pretty ok with option like :camelcase => true.

But this is more likely to bring problems than solve them: track some helper usage in code becomes harder.

Anyway @jtrim concerns sounds reasonable to me.

from js-routes.

jtrim avatar jtrim commented on June 20, 2024

@bogdan I tend to agree with your assertion on tracking helper usage in a library. However, a problem isn't any less of a problem simply because the solution is hard.

from js-routes.

bogdan avatar bogdan commented on June 20, 2024

@jtrim you can go ahead with a patch. Please also update a doc and add a test case.

from js-routes.

jtrim avatar jtrim commented on June 20, 2024

Sounds good, will do. Thanks guys!

from js-routes.

slash avatar slash commented on June 20, 2024

You can actually do both. As the holy-war of the case will never end.
I don't think it will generate any issues, except for the fact that there will be a bit more code.
And confusion when people will use both cases in the same source.

from js-routes.

ches avatar ches commented on June 20, 2024

@slash Don't generate both cases -- in addition to inviting people to deviate from whatever the project's convention is as you mentioned, it'd double the size of the routes JS file.

from js-routes.

le0pard avatar le0pard commented on June 20, 2024

I think we can also close this issue :)

from js-routes.

Related Issues (20)

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.