Questions tagged [class-names]
86 questions
0
votes
1 answer
Get association from custom name
My Seminar model has a column named teacher_id. That part of the relationship is working. I can call seminar.teacher to retrieve the User who teaches that seminar.
I'd like to be able to invert that query. In other words, I need to call…

Jeff Zivkovic
- 547
- 1
- 4
- 20
0
votes
1 answer
Can not see my class using classnames and React?
Using React and classnames to do styles. I get no errors but I get undefined when I console.log(styles.uiPad). I do get an object when I console.log(styles). My classnames import component also gets console.logged successfully but nothing happens.…

rrudy90023
- 63
- 2
- 8
0
votes
2 answers
How can I apply classNames in react to change the background color of one of the child div in React
I have 3 children divs wrapped in one parent div as shown :
On click of each child div, I want its background-color to be changed to red. but if there is already one div with background-color red and some other div is clicked then its background…

Ajay Gaur
- 5,140
- 6
- 38
- 60
0
votes
1 answer
How to add classes to host in angular 2?
I need to add a class attribute dinamically the a host component made with Angular 2.
What I want to do isn't this way:
How to add "class" to host element?
In the case above it would be necessary the hardcoding of the class. My objective is to add a…

Natanael
- 2,290
- 6
- 23
- 35
0
votes
2 answers
Derive a class name from another class name in template
In order to use a library, I need to use different classes that have the same base name. I.e.
MyClass
MyClassImpl
PreMyClass
And so on. in order to use them with template I need pass all these class names.
template

Jepessen
- 11,744
- 14
- 82
- 149
0
votes
1 answer
Requiring a gem with a system class naming conflict
I'm writing a build script in Rake that uses a couple of 3rd party gems. One of these gem defines a class called Hash.
class Hash
alias hkeys keys
def keys
hkeys.sort {|a,b| a.to_s <=> b.to_s }
end
def each
keys.each { |k| yield k,…

Coder1095
- 828
- 10
- 25
0
votes
2 answers
Add/Remove multiple classes on multiple elements simultaneously
What I'm trying to achieve is using a single element, by onclick, is add and remove 2 class names on 2 independent elements simultaneously.
Here is my element I'm using to trigger the js/jquery.
0
votes
5 answers
Use variable's string into class names or other
I want to use variables inside class names.
For example, let's set a variable named $var to "index2".
Now I want to print index2 inside a class name like this:
controller_index2, but instead of doing it manually, I can just print the var name there…

Junatanm Degraded
- 137
- 1
- 14
0
votes
0 answers
Get all class names from element
What I am trying to achieve is just to get all class names which are used with a certain element.
The problem is that when I use my various methods to get the class names, only the first class is being returned.
Lets say I have a table, where each…

Phillip-juan
- 546
- 4
- 29
0
votes
2 answers
load page according to class names
I've got code like this on my page:
I want something…

Hintswen
- 3,987
- 12
- 40
- 45