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;
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
add a comment |
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
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
add a comment |
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
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
html css ruby-on-rails ruby hyperstack
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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!
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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!
add a comment |
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!
add a comment |
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!
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!
answered Mar 28 at 0:24
adamcreekroadadamcreekroad
762 bronze badges
762 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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