Devise undefined method `users_url' for # |
The profile you're creating with Profile.create(user_id: self.id,
user_name: self.name) isn't associated with any User. In order to build a
has_one dependency, use the build_resource method on self in an
after_create callback:
# app/models/user.rb
class User < ActiveRecord::Base
has_one :profile, :dependent => :destroy
after_create :myprofile
def myprofile
profile = Profile.create!(user_id: self.id, user_name: self.name) #
`.create!` will throw an error if this fails, so it's good for debugging
self.profile = profile
end
end
|
Error with Devise - Cannot run rails s or any devise commands |
Maybe you can shifting to rails edge.
gem 'rails', github: 'rails/rails'
gem "devise", "~> 3.0.1"
(https://github.com/rails/rails/issues/10559)
|
Devise : No route matches {:controller=>"devise/about"} |
Check your log files (log/development.log) for more information on the
error - you are most likely coding a link on that page with an invalid
route.
Note that the error is about devise/about, not the users/sign_up that
you're visiting.
|
Rails: User does not respond to 'devise' method” when running “rails generate devise:install" |
It looks like you have devise generator previously run unsuccessfully.
Backtrace gives a clue that error happens within config/routes.rb line 2. I
guess there is a following line of code, setting up devise routes
devise_for :users
But your users model doesn't have devise modules setup. There should be
something like
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :timeoutable and :omniauthable
devise :database_authenticatable, :rememberable, :trackable, :validatable
If this line is present it means that devise is improperly installed.
Also there is a chance that you have another class or module "User" within
ActiveSupport::Dependencies autoloader paths and when devise_for :users
line requires User class this class/module loaded fir
|
Devise + Facebook omniauth: The action 'facebook' could not be found for Devise::OmniauthCallbacksController |
Change your devise route to
devise_for :users, :controllers => { :omniauth_callbacks =>
"users/omniauth_callbacks" }
to make sure it matches your controller definition.
|
CSS styling |
<div class="headerClear" /></div>
see this div has unexpected close the right method is
<div class="headerClear"></div>
replace with this and add this to your css
body{ margin:0px;}
|
styling div with javascript |
Have you tried putting breakpoints on the var, var and if lines? Then
slowly stepping through the code? I'd be curious if "slowing" down the
JavaScript allows the correct elementheight and screenheight to be
obtained. It's not much of an answer, but I had a similar situation where
I had to slow down the code by putting a timer on it so it could get the
right dimensions of my element, then continue on to my if statement after
the fact. I'd show the code, but that is with a former employer...
I hope in some way this helps.
|
Text box styling |
Replace
<ContentPresenter
HorizontalAlignment="Center" VerticalAlignment="Center" />
with
<ScrollViewer
x:Name="PART_ContentHost"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
ScrollViewer named PART_ContentHost is a mandatory part of any TextBox
control template. You should use Default WPF Control Styles and Templates
as reference instead of coming up with your own template.
|
Using LESS for custom styling |
Wrote an MSBuild target to compile all the LESS files for each of the
different customers using the dotless compiler. The target uses the
FileUpdate task from MSBuildTasks to amend the variables Import statement
in each LESS file prior to the compilation task e.g @import
'/css/default/variables.less' is changed to '/css/customer1/variables.less'
etc.
|
DisclosurePanel styling bug? |
I have noticed sometimes this "selection border" for my disclosure panels
when was working in debug mode. Did not see this in production mode though.
If you really need to get rid of that effect by all means, you can try to
set "outline: none;" to your disclosurePanel.getHeader().getParent() which
will prevent showing the highlighted border (which is usually OK for active
focused element in new browsers) for <a href=...> element that wraps
the disclosure panel's header.
You may also check what is happening with that header in devtools, when you
see the unexpected space between elements. And compare that to what you see
after refresh. So you may notice the difference and then find out what
causes that.
|
Styling navigation through CSS |
You can try something like:
#navi img, #navi a {
float: left; /* float next to each other on the left hand side */
}
#navi a { /* use some padding to have some empty space */
padding: 5px;
border-right: 1px solid #ffffff;
}
#navi a:hover { /* on hover, background white on A tags */
background: #ffffff;
}
And than play untill it fits, with the right side you could do the same,
inside the nav you can float it to the right. If you want to have a
seperate DIV you should also float this #navi to the left and the #social
to the right.
If you only use padding on an element (which is blocked) the text will
always be centered because the padding left / right are the same.
TIP: If you use floats like this and you want an item to be on a new line.
Normally it would be set next to
|
DIV styling problems |
Like this
DEMO
CSS
* {
margin: 0;
padding: 0;
}
#header {
background-color: #ED1C24;
display: table;
vertical-align: middle;
}
#logo {
width: 130px;
height: 45px;
background: url(image.png);
position: relative;
margin: 4px 0 0 2px;
display: table-cell;
}
#search-box {
width: 440px;
padding: 2px 8px;
position: relative;
margin-left: 90px;
display: table-cell;
}
#panes {
width: 170px;
height: 48px;
position: relative;
margin-right: 10px;
display: table-cell;
}
|
Styling Wpf Pie Chart |
I think that you should be able to use a Color Palette. Take a look at the
How to set a default colour to the Pie slices in WPF Pie chart post here on
StackOverflow.
Additionally, take a look at the Chart Appearance article on MSDN.
|
CSS styling for Mono C# |
I think Pixate tries to do this.
https://github.com/Pixate/MonoTouch-Pixate
No idea how good it is though.
|
Styling Inconsistencies |
This will fix your image issue
<img style="border:none" src="./Seltec Computers - Contact
Us_files/logo.png">
I'm still working on your footer issue, I'll post back when I solve the
issues
|
Styling the last 5th li in my list |
The issue is that the li isn't the n'th child, they are each within a
<h4> element. if you use :
.home h4:nth-child(10) li {padding-top: 20px;}
This should resolve the problem
|
Styling a heading using CSS |
I don't recommend using for styling (and keeping space is
styling).
Padding is used to create inner element-spacing. And that's what you need.
Try adding the following CSS styling:
h3 {
padding-left: 10px; /* You can change this number */
}
You can create the left "decoration" by adding a border:
h3 {
padding-left: 10px; /* You can change this number */
border-left: 3px solid orange; /* You can change the color and width */
}
|
Text styling in CSS |
That is because you need to print this:
footer {
background: #333;
}
footer p {
color: #FFFFFF;
font-size: 60%;
font-family: tahoma, sans-serif;
text-align: center;
margin: 0;
padding: 10px 0;
}
instead of this:
footer {
background: #333;
color: #ccc;
font-size: 70%;
font-family: tahoma, sans-serif;
text-align: center;
margin: 0;
padding: 10px 0;
}
In CSS you always need to cut your code on p, h2 a, span etc.
|
change another div's styling using only css |
You can do it using pure CSS
DEMO http://jsfiddle.net/kevinPHPkevin/daFDn/1163/
img.tree:hover ~ ul .tree {
background:#ccc;
}
img.lion:hover ~ ul .lion {
background:#ccc;
}
In your case you would assign the country hover to the correct list
element. Ive used two random pictures just for examples sake, but the
theory applies. These selectors are supported IE7+
EDITED
If you want to support all browsers then offer a jQuery backup support, or
a jQuery only solution
DEMO http://jsfiddle.net/kevinPHPkevin/daFDn/1167/
$('.lion-img').hover(
function () {
$('.lion').addClass('active');
},
function () {
$('.lion').removeClass('active');
}
);
$('.tree-img').hover(
function () {
$('.tree').addClass('active');
},
function () {
$('.tree').removeClass('a
|
CSS Waiting Bar? Styling |
It's called a caret and there is no way to style it using CSS, as its
behavior is decided by the browser.
You can use Javascript, however, to achieve a *fake*y result.
|
Styling with flex in CSS |
just apply this before the closing head...
<style>
.slimScrollDiv {white-space: nowrap; width:100%; height:100%;
background:#DBDBDB;}
.slimScrollContent {margin:5px;}
.area {
background: #FFFFFF;
border-radius: 15px;
box-shadow: 0px 0px 20px 1px #303030;
margin:10px;
padding: 10px;
width:12em;
min-height:12em;
display:inline-block;
}
.main {
width:50%;
height:90%;
}
.flexContainer {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
list-style: none;
-webkit-flex-flow: column wrap;
justify-content: space-around;
}
</style>
|
Styling tables using CSS |
I'll provide you a CSS solution for this:
table.class_name tr:nth-child(odd) {
/* Styles */
}
table.class_name tr:nth-child(even) {
/* Styles */
}
That's all you need, although it’s not supported in IE 8 and earlier.
Demo
For your table headers, you can simply use a different selector to over
ride the background styles like
table.altrowstable tr th {
background: #fff;
}
Demo 2
|
PHP variable and styling |
Try using double quotes for your HTML attributes and concatenate your
$first variable, like so:
$user = "$email";
$usersubject = "Thank you for subscribing";
$userheaders = "From: subscriptions@3elementsreview.com
";
$userheaders .= "Content-type: text/html
";
$usermessage = "Welcome <span style="color:#ff6000; font-size:1.25em;
font-weight:bold;">".$first."</span>,
We're glad you've decided to subscribe to our email list!
There's a lot of great things happening at 3Elements that we can't wait to
show you.
So stay tuned for notifications about submission periods, issue release
dates, contests, and other news. Also, be sure to like us on Facebook and
follow us on Twitter!
Sincerely,
The 3Elements Team
www.3ElementsReview.com
Facebook.com/3elementsreview
@3ElementsRevie
|
WPF label styling |
The error is correct, you cannot set a corner radius on a Label.
What you can do is wrap the Label with a Border and apply your style to
that to get the desired look.
EDIT:
The Style Resource:
<Style x:Key="MyBorderStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="White" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="CornerRadius" Value="3" />
</Style>
The border wrapped label:
<Border Style="{StaticResource MyBorderStyle}">
<Label Content="My Label" />
</Border>
|
Styling menu bar css |
Not sure if i understand, but try add bakground to the a element. After it
looks like your second attached image.
ul#menu li a {
background:black;
}
And you must comment spaces between li elements:
<ul id="menu">
<div id="menuborders1">
<div id="menuborders2"><!--
--><li class="current"><a href="#"
data-id="div1">Description</a></li><!--
--><li><a href="#" data-id="div2">Shipping and
payment</a></li><!--
--><li><a href="#"
data-id="div3">Returns</a></li><!--
--><li><a href="#"
data-id="div4">Feedback</a></li><!--
--></div>
</div>
</ul>
http://jsfiddle.net/Qn3kh/4/
According
|
Navigation Bar Styling with Css |
Simply apply .active to the navigation item you require to be active.
HTML
<li><a href="#" class="active">Home</a></li>
CSS
ul.topnav li a.active {
border-top: 5px solid orange;
}
|
Css styling in rails |
Apart from that your HTML markup is terrible wrong, for example you can not
have a li tag within a span tag. Check your site out at
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.leapfm.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0.
You can not add margin and padding to a span without it being a block
object.
If you add display:block to your .subtext it will sit closer to your title
and can have more margin at the bottom.
|
Styling problems using CSS |
Do you have a reset sheet?
Copy this to a new css file, call it reset.css and then load it in your
page before you load your main css.
html{color:#000;background:#FFF}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}
table{border-collapse:collapse;border-spacing:0}
fieldset,img{border:0}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}
ol,ul{list-style:none}
caption,th{text-align:left}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}
q:before,q:after{content:''}
abbr,acronym{border:0;font-variant:normal}
sup{vertical-align:text-top}
sub{vertical-align:text-bottom}
input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit}
input,textarea,select{*fon
|
Styling sub menu |
You need to put the sub-menu ul inside the li-element, like so:
<nav id="navbar_text">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="aboutus.html">About</a></li>
<li><a href="#">Products</a>
<ul class="submenu">
<li><a href="index.html">Fireplaces &
Accessories</a></li>
<li><a
href="aboutus.html">Stoves</a></li>
<li><a href="aboutus.html">Outdoor
Kitchens</a></li>
<li><a href="aboutus.html">Gas
Grills</a></li>
</ul>
</li>
<li><a href="#">Servic
|
CSS: Styling IDs not having any effect |
You can start ID selectors with a number(To Elaborate more look at Xec's
answer), but within CSS its not good practice, it needs to be escaped or
begin with a letter. I recommend you change it with a name like id="img2"
in the HTML. and also use #img2 in css
|
Styling DropDownList ASP.NET |
Something like this?
CSS:
.styled-select {
width: 308px;
height: 23px;
overflow: hidden;
background:url(arrow_xs.png) no-repeat 225px #FFF;
border: 1px solid #ccc;
}
.styled-select select {
background: transparent;
width: 309px;
padding-right: 4px;
padding-bottom:7px;
padding-left: 4px;
padding-top: 0px;
font-size: 12px;
line-height: 1;
border: none;
border-radius: 0;
height: 34px;
-webkit-appearance: none;
}
HTML
<div class="styled-select">
<select>
<option>First option</option>
<option>Second option</option>
</select>
</div>
edit: You can add an arrow with positioning (div).
edit I put this in a jsfiddle for you: http://jsfiddle.net/X4J3L/
|
Hover Styling CSS |
Try using a reset [1].
Simply checking the Normalized CSS[2] box in Fiddle Options solves this.
http://jsfiddle.net/H9CTe/2/
(will update)
|
Django CheckBox styling |
Try adding a label
<input type="checkbox" class="myClass" value="yes" id="answer"
name="answer"/><label
for="answer">{{user.name}}</label><br>
|
jQuery styling if certain value requirements of a | are met |
Firstly td elements do not have the val property.
Need to use .text to get the text
Next use parseInt to convert it to a number
if (n > 50) {
supposed to b e
if (parseInt(n, 10) > 50) {
But because you are specifically setting each td to a specific color. You
need to iterate over the list using $.each. You can also use .filter as
well.
// Will return all the `tds` with the value
var $red = $('.red').filter(function() {
return parseInt( $(this).text(), 10) > 50;
});
// Set the red elements to color red
$red.css('color', 'red');
// All `.red` which are not in above selector are selected
$('.red').not($red).css('color', 'blue');
Using Filter Demo
Using Each Demo
|
CSS styling issue help required |
I have took a look at your fiddle and when applying the 25% to the width
CSS on the .equal and making the width of the .effect 100% nothing seems to
have changed. It all seems to work fine and not stick together like you
stated. I'm unsure as to what problems you are facing as the fiddle seems
to be running fine with the desired percentages.
|
CSS selectors for styling the word "bar" |
Parent and child relationship. In all of these you are choosing the parent
and navigating throught to the first child. If you had a list you would
have to navigate through selectors with a nth child selector.
|
css styling and alignment issue |
Wrap the content you want beside the left navigation menu in a new div
element. Then add float:left to this container and the navigation menu. In
a nutshell, you need to float both siblings to make them side by side.
Since there is not an apparent sibling, I suggesting making one by wrapping
your content.
HTML
<div id="container">
<header>
<h1>Index page</h1>
</header>
<nav role="navigation" id="nav">
<ul>
<li><a class="index"
href="index.php">Home</a></li>
<li><a class="about"
href="about.php">About</a></li>
<li><a class="contact"
href="contact.php">Contact</a></li>
</ul
|
CSS: Trigger styling for the sibling |
You have two problems:
You are using the border shorthand syntax with the border-color property
You need to select both elements, not just the button.
Such:
#mytextfield:focus,
#mytextfield:focus + #mysubmitbutton{
border:solid 1px red;
}
Here's the fiddle to check this out:
http://jsfiddle.net/za4EW/
|
Trying to achieve this styling for messages |
HTML:
<div class="row">
<div class="span12">
<div id="message-container">
<div class="message">
<img src="images/message_avatar.jpg" alt="Profile Avatar" />
<div class="entry-content">
<h2>Charles Geschke</h2>
<h3 class="time">10:00 A.M</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nunc condimentum a nunc sit amet bibendum. Vivamus vel eros at turpis
volutpat euismod quis eget dui. Nunc a ultrices lacus, eget porta ipsum.
Phasellus vel ornare urna. Cras accumsan ipsum a dui vestibulum mattis.
Aenean a arcu porttitor quam molestie auctor.</p>
</div>
</div>
</div>
</div>
</div>
CSS:
.message img,
.
|
Styling the output of an XQuery |
To have the xslt-transformation done by the browser, the stylesheet
processing instruction should appear before the first XML element
(http://www.w3.org/TR/xml-stylesheet/) of the document;
It is possible to add the Processing Instruction by constructing it the
following way:
processing-instruction xml-stylesheet
{'type="application/xml"','href="test.xsl"'},
<myxml/>
The alternative is to use the transform() functions to do the
transformation on the server side:
http://exist-db.org/exist/apps/doc/xsl-transform.xml
|