Hyperstack add dynamic class to manual class namesHow to change an element's class with JavaScript?How do I get a div to float to the bottom of its container?Convert HTML + CSS to PDF with PHP?Which characters are valid in CSS class names/selectors?How can I select an element by name with jQuery?class << self idiom in RubyIs there are way to make a child DIV's width wider than the parent DIV using CSS?What is the best way to conditionally apply a class?CSS transition shorthand with multiple properties?How to add a second css class with a conditional value in razor MVC 4

Federal Pacific 200a main panel problem with oversized 100a 2pole breaker

How to force GCC to assume that a floating-point expression is non-negative?

Do sharpies or markers damage soft rock climbing gear?

How to pass 2>/dev/null as a variable?

Is the internet in Madagascar faster than in UK?

Is there any problem with a full installation on a USB drive?

Book featuring a child learning from a crowdsourced AI book

Why did James Cameron decide to give Alita big eyes?

Is there an in-universe explanation given to the senior Imperial Navy Officers as to why Darth Vader serves Emperor Palpatine?

Notice period 60 days but I need to join in 45 days

Can an object tethered to a spaceship be pulled out of event horizon?

Defending Castle from Zombies

Why did Lucius make a deal out of Buckbeak hurting Draco but not about Draco being turned into a ferret?

Is it true that different variants of the same model aircraft don't require pilot retraining?

Can I lend at the federal funds rate?

Unlock your Lock

How to determine algebraically whether an equation has an infinite solutions or not?

Number of Fingers for a Math Oriented Race

Shift lens vs move body?

Why didn't Doc believe Marty was from the future?

How can I download a file from a host I can only SSH to through another host?

Why was this commercial plane highly delayed mid-flight?

Term used to describe a person who predicts future outcomes

Why is getting a PhD considered "financially irresponsible" by some people?



Hyperstack add dynamic class to manual class names


How to change an element's class with JavaScript?How do I get a div to float to the bottom of its container?Convert HTML + CSS to PDF with PHP?Which characters are valid in CSS class names/selectors?How can I select an element by name with jQuery?class << self idiom in RubyIs there are way to make a child DIV's width wider than the parent DIV using CSS?What is the best way to conditionally apply a class?CSS transition shorthand with multiple properties?How to add a second css class with a conditional value in razor MVC 4






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I need to add a dynamic class to some regular classes while updating syntax for Hyperstack:



div.upload_header.text_left(class: ('uploaded' if 
FileUploads.complete?)) do


Should become something like this:



DIV(class: 'upload-header text-left (dynamic 'uploaded' should go 
here)') do


I just can't seem to figure out how/if regular and dynamic classes can be declared together.










share|improve this question
























  • Welcome to Stack Overflow. You need to add some precision to your question. What is your problem, what have you tried and what is your question. Please see: How to ask

    – probitaille
    Mar 27 at 20:49











  • FYI matt the old haml style (i.e. div.upload_header) is deprecated so you want to get rid of that stuff anyway.

    – Mitch VanDuyn
    Mar 28 at 14:56

















3















I need to add a dynamic class to some regular classes while updating syntax for Hyperstack:



div.upload_header.text_left(class: ('uploaded' if 
FileUploads.complete?)) do


Should become something like this:



DIV(class: 'upload-header text-left (dynamic 'uploaded' should go 
here)') do


I just can't seem to figure out how/if regular and dynamic classes can be declared together.










share|improve this question
























  • Welcome to Stack Overflow. You need to add some precision to your question. What is your problem, what have you tried and what is your question. Please see: How to ask

    – probitaille
    Mar 27 at 20:49











  • FYI matt the old haml style (i.e. div.upload_header) is deprecated so you want to get rid of that stuff anyway.

    – Mitch VanDuyn
    Mar 28 at 14:56













3












3








3








I need to add a dynamic class to some regular classes while updating syntax for Hyperstack:



div.upload_header.text_left(class: ('uploaded' if 
FileUploads.complete?)) do


Should become something like this:



DIV(class: 'upload-header text-left (dynamic 'uploaded' should go 
here)') do


I just can't seem to figure out how/if regular and dynamic classes can be declared together.










share|improve this question














I need to add a dynamic class to some regular classes while updating syntax for Hyperstack:



div.upload_header.text_left(class: ('uploaded' if 
FileUploads.complete?)) do


Should become something like this:



DIV(class: 'upload-header text-left (dynamic 'uploaded' should go 
here)') do


I just can't seem to figure out how/if regular and dynamic classes can be declared together.







html css ruby-on-rails ruby hyperstack






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 20:42









Matt SaginarioMatt Saginario

434 bronze badges




434 bronze badges















  • Welcome to Stack Overflow. You need to add some precision to your question. What is your problem, what have you tried and what is your question. Please see: How to ask

    – probitaille
    Mar 27 at 20:49











  • FYI matt the old haml style (i.e. div.upload_header) is deprecated so you want to get rid of that stuff anyway.

    – Mitch VanDuyn
    Mar 28 at 14:56

















  • Welcome to Stack Overflow. You need to add some precision to your question. What is your problem, what have you tried and what is your question. Please see: How to ask

    – probitaille
    Mar 27 at 20:49











  • FYI matt the old haml style (i.e. div.upload_header) is deprecated so you want to get rid of that stuff anyway.

    – Mitch VanDuyn
    Mar 28 at 14:56
















Welcome to Stack Overflow. You need to add some precision to your question. What is your problem, what have you tried and what is your question. Please see: How to ask

– probitaille
Mar 27 at 20:49





Welcome to Stack Overflow. You need to add some precision to your question. What is your problem, what have you tried and what is your question. Please see: How to ask

– probitaille
Mar 27 at 20:49













FYI matt the old haml style (i.e. div.upload_header) is deprecated so you want to get rid of that stuff anyway.

– Mitch VanDuyn
Mar 28 at 14:56





FYI matt the old haml style (i.e. div.upload_header) is deprecated so you want to get rid of that stuff anyway.

– Mitch VanDuyn
Mar 28 at 14:56












1 Answer
1






active

oldest

votes


















4















String interpolation can be done conditionally:



DIV(class: "upload-header text-left #'uploaded' if FileUploads.complete?")


The class parameter can also accept an array:



def upload_header_classes
['upload-header', 'text-left'].tap do |classes|
classes << 'uploaded' if FileUploads.complete?
end
end

DIV(class: upload_header_classes)


I'm sure there are plenty of other ways to do it too, this is ruby!






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386110%2fhyperstack-add-dynamic-class-to-manual-class-names%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4















    String interpolation can be done conditionally:



    DIV(class: "upload-header text-left #'uploaded' if FileUploads.complete?")


    The class parameter can also accept an array:



    def upload_header_classes
    ['upload-header', 'text-left'].tap do |classes|
    classes << 'uploaded' if FileUploads.complete?
    end
    end

    DIV(class: upload_header_classes)


    I'm sure there are plenty of other ways to do it too, this is ruby!






    share|improve this answer





























      4















      String interpolation can be done conditionally:



      DIV(class: "upload-header text-left #'uploaded' if FileUploads.complete?")


      The class parameter can also accept an array:



      def upload_header_classes
      ['upload-header', 'text-left'].tap do |classes|
      classes << 'uploaded' if FileUploads.complete?
      end
      end

      DIV(class: upload_header_classes)


      I'm sure there are plenty of other ways to do it too, this is ruby!






      share|improve this answer



























        4














        4










        4









        String interpolation can be done conditionally:



        DIV(class: "upload-header text-left #'uploaded' if FileUploads.complete?")


        The class parameter can also accept an array:



        def upload_header_classes
        ['upload-header', 'text-left'].tap do |classes|
        classes << 'uploaded' if FileUploads.complete?
        end
        end

        DIV(class: upload_header_classes)


        I'm sure there are plenty of other ways to do it too, this is ruby!






        share|improve this answer













        String interpolation can be done conditionally:



        DIV(class: "upload-header text-left #'uploaded' if FileUploads.complete?")


        The class parameter can also accept an array:



        def upload_header_classes
        ['upload-header', 'text-left'].tap do |classes|
        classes << 'uploaded' if FileUploads.complete?
        end
        end

        DIV(class: upload_header_classes)


        I'm sure there are plenty of other ways to do it too, this is ruby!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 0:24









        adamcreekroadadamcreekroad

        762 bronze badges




        762 bronze badges



















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386110%2fhyperstack-add-dynamic-class-to-manual-class-names%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript