我想在rails app中将用户glyphicon添加到我的登录输入框中,我目前正在使用Rails 4.2.3和Ruby 2.2.0
我试图搜索这个已经有一段时间但是还没有找到如何将它添加到rails应用程序并且希望我的代码尽可能保持ruby并且如果可能的话(如果不是我想html就足够了)但我很乐意学习如何在rails语法中做到这一点。
任何帮助将不胜感激。
到目前为止,我的输入字段看起来像这样。
<div class="input-group input-group-lg">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
如果可能的话,我会喜欢左边的字形和输入框右边的占位符。
答案 0 :(得分:3)
<%= button_tag raw("<i class='srch-control-icon-srch'></i> search"), class: "button round" %>
答案 1 :(得分:0)
<强> HTML 强>
#include<stdlib.h>
#include<stdio.h>
typedef struct _person_count {
char country[80];
long females;
long males;
struct _person_count *link;
} person_count;
void printList(person_count *node) {
if (node != NULL) {
printf("%25s %10d %10d %10d \n", node->country, node->females,
node->males, node->males + node->females);
printList(node->link);
}
}
int main() {
FILE *infile;
infile = fopen("file.txt", "r");
if (infile == NULL) {
printf("Problem opening files.");
return 1;
}
person_count *first = NULL;
person_count *curr = NULL;
person_count *prev = NULL;
person_count *a = NULL;
do {
person_count *newNode = malloc(sizeof(person_count));
fscanf(infile, "%s %ld %ld", &newNode->country, &newNode->females,
&newNode->males);
newNode->link = NULL;
if (first == NULL) {
first = newNode;
} else {
prev->link = newNode;
};
curr = first;
if ((newNode->females + newNode->males)
> (first->females + first->males)) {
newNode->link = first;
first = newNode;
} else {
do {
if (curr->link == NULL) {
curr->link = newNode;
printf("a\n");
break;
}
if ((newNode->females + newNode->males)
< (curr->link->females + curr->link->males)) {
curr = curr->link;
printf("b\n");
continue;
} else {
newNode->link = curr->link;
curr->link = newNode;
printf("c\n");
break;
}
} while (curr->link->link != NULL);
}
prev = newNode;
} while (!feof(infile));
printList(first);
printf("\n\n\nnew\n\n\n");
printList(curr);
return 0;
}
小提琴Here