I'm using Ruby on Rails and I'm facing a problem.
When i run my application on the server, I get the following:
<link rel="stylesheet" media="all" href="/assets/..self-f28d8f57a7f19b756969e1ff016e5d807dd2b40d26e0e65c1a849f82fa5bd4b8.css?body=1" data-turbolinks-track="true" />
<link rel="stylesheet" media="all" href="/assets/reset.self-6aa5650b7ba29c22295359e84be792256c2c0e09887497329e717eb441b2878c.css?body=1" data-turbolinks-track="true" />
<link rel="stylesheet" media="all" href="/assets/application.self-dae5c5da7223ce739ad497817a3df9ba2fa2840da302653b11558b4f7d98bfc3.css?body=1" data-turbolinks-track="true" />
application.css is the default CSS that compiles all the SASS into one file, then you have reset.css that's added manually by me, and finally you have ..self.css.
This is the problem. This file is supposed to be index.scss. (I know it, because when I delete and create it by myself it loads correctly.)
rails generate controller
In the SCSS and JS files generated by the method when running the server the name is replaced by a dot.
Can someone help?
Related
I am trying to run this links with thymeleaf but it doesnt work
, the static version with th: runs fine but when using jetty and trying to get thesame css files at run time it does not work
<link rel="stylesheet"
href="../../resources/static/css/font-awesome.min.css"
th:href="#{/resources/static/css/font-awesome.min.css}">
<link rel="stylesheet"
href="../../resources/static/css/bootstrap.css"
th:href="#{/resources/static/css/bootstrap.css}">
If you're accessing your app from http://localhost:8080, try removing the absolute path.
See if this works:
<link rel="stylesheet"
th:href="#{/resources/static/css/font-awesome.min.css}"
href="/css/font-awesome.min.css" />
<link rel="stylesheet"
th:href="#{/resources/static/css/bootstrap.css}"
href="/css/bootstrap.css" />
Also, try to access you css on the browser URL to see if it shows its content:
http://localhost:8080/css/font-awesome.min.css
or
http://localhost:8080/css/bootstrap.css
Hope it's somehow useful.
It seems that the Rails asset pipeline isn't functioning correctly in my development environment. I'm experiencing the following issues:
Manifest files are being served in addition to other files.
Files are not being concatenated.
Some of the files that are served are completely empty.
These issues apply to both CSS and JavaScript assets. Below is a copy of the HTML output (I haven't edited the default rails layout). Note the presence of the manifest files and all the assets (which should be concatenated into a single file).
<!DOCTYPE html>
<html>
<head>
<title>Jackeyes</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/home.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/universal.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/home.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.waitforimages.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="0AZh7mNJS7R1jsHKyZ5eKBrAON10Jra2677A8Lg3wzw=" name="csrf-token" />
</head>
<body>
I'm new to Rails, so I'm not sure how to begin resolving this. Any help would be greatly appreciated!
This is the default behaviour for rails in a development environment. I would suggest reading about asset pipeline in the rails guides.
During development, it tends to make things easier to debug if your assets are in separate files. For example, if you're using firebug in Firefox, you can look at each separate javascript file to see your compiled coffee output, set breakpoints, etc. It could also become inefficient to concatenate resources on each request, which tends to be important in a development environment where you're constantly changing assets and loading pages.
If you want to have everything concatenated while in development though, you set config.assets.debug = false in app/config/environments/development.rb.
I'm using jqGrid 4.4.0 in an mvc2 application. The grid loads with the data fine. However, when I edit/add or delete records I get an 'Object doesn't support this property or method' error. This is how my setup looks like on the site.master page:
<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/themes/redmond/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="../../Content/ui.jqgrid.css" />
<script src="<s:url value= http://ajax.microsoft.com/ajax/jquery/jquery-1.7.min.js" type="text/jscript"></script>
<script src="../../Scripts/grid.locale-en.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.jqGrid.min.js" type="text/javascript"></script>
What am I missing?
okay, even i got this error many times...i worked it out with two solution...first try this one, if it doesn't work for you...then paste your exact code here, where u r getting that error.
you need to include this grid.inlinedit.js if you are doing inline edit and grid.formedit.js if you are doing form edit...let me know if this sloves your problem or not...if it doesn't i'll provide the second solution
i have some script..it lies in some direktori :
var/www/html/dataTables-1.6/media/css/demo_page.css
how to put in html page?
<link href=......??? rel="stylesheet" type="text/css" media="all">
Assuming html is your webroot, place the following in your head tag.
<link href="/dataTables-1.6/media/css/demo_page.css" rel="stylesheet" type="text/css" media="all">
Is this what you were asking?
You could use the full server path "/location/of/the/file/here.css" or you could use the relative path from where the file you are placing it in resides. "../back/one/directory.css". Or you could use the full web URL for it "http://www.yourhost/yourwebRoot/yourfile.css".
I am working in an ASP.NET MasterPage and am having trouble with <link href="..." />.
I am trying to substitute in a stylesheet with a specific name:
<link href="/Content/Styles/<%=Model.Style%>.css" rel="stylesheet" type="text/css" />
Unfortunately, this creates the HTML output:
<link href="/Content/Styles/<%=Model.Style%>.css" rel="stylesheet" type="text/css" />
Which is clearly not what was intended.
If I put the same code in a View placeholder, it works perfectly. This is not a good solution though as I have many pages where I just want it to do the same thing.
It looks like it's trying to automatically correct the URL - is there a way to switch this off?
Edit 1:
I have fixed this temporarily using:
<link href=<%=String.Format("\"/Content/Styles/{0}.css\"", Model.Style)%> rel="stylesheet" type="text/css" />
All the links in your question and in the solution posted thus far will fail if your site is deployed in a virtual folder. Instead, do:
<link href="<%= Url.Content("~/Content/Styles/" + Model.Style + ".css") %>" rel="stylesheet" type="text/css" />
This (1) fixes the problem in your question, and (2) allows your site to work in a virtual folder.
Try this:
<link href="/Content/Styles/<%= "" + Model.Style%>.css" rel="stylesheet" type="text/css" media="screen" />
Ugly but works.