haml data Boolean Attributes - haml

I am trying to render a data boolean attribute like this
= stylesheet_link_tag 'email-mobile', :'data-roadie-ignore' => true
When I render the html file with mailer preview I inspect the css and I can spot the following.
<link rel="stylesheet" media="screen" href="/assets/ema...." data-roadie-ignore="true">
Shouldn't be displaying
<link rel="stylesheet" media="screen" href="/assets/ema...." data-roadie-ignore> ?
I have tried to update the haml.rb file
Haml::Template.options[:format] = :html5
Haml::Options.defaults[:format] = :html5
But still doesn't work.

Related

Kendo Vue Charts Native CDN Install Errors

According to documentation these are the files that need to be added
<script src="https://unpkg.com/#progress/kendo-vue-charts#latest/dist/cdn/js/kendo-vue-charts.js"></script>
<script src="https://unpkg.com/#progress/kendo-vue-intl#latest/dist/cdn/js/kendo-vue-intl.js"></script>
<script src="https://unpkg.com/#progress/kendo-drawing/dist/cdn/js/kendo-drawing.js"></script>
// Load the Kendo Default Theme
<link rel="stylesheet" href="https://unpkg.com/#progress/kendo-theme-default#latest/dist/all.css">
// Load the Kendo Bootstrap Theme
<link rel="stylesheet" href="https://unpkg.com/#progress/kendo-theme-bootstrap#latest/dist/all.css">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<link rel="stylesheet" href="https://unpkg.com/#progress/kendo-theme-default#latest/dist/all.css">
<link rel="stylesheet" href="https://unpkg.com/#progress/kendo-theme-bootstrap#latest/dist/all.css">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://unpkg.com/#progress/kendo-vue-charts#latest/dist/cdn/js/kendo-vue-charts.js"></script>
<script src="https://unpkg.com/#progress/kendo-vue-intl#latest/dist/cdn/js/kendo-vue-intl.js"></script>
<script src="https://unpkg.com/#progress/kendo-drawing/dist/cdn/js/kendo-drawing.js"></script>
The Error is
Cannot read properties of undefined (reading 'support') at Module. (kendo-vue-charts.js:1:28556)
The order of the script tags is wrong - we need to put the drawing script tag first, then the intl and last but not least the charts script.

I got 'is not defined' when trying to access class from a CDN loaded on Vue js

While trying to use Twilio TaskRouter JS SDK on Vue JS, that you have load through CDN.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="https://sdk.twilio.com/js/taskrouter/v1.21/taskrouter.min.js" integrity="sha384-5fq+0qjayReAreRyHy38VpD3Gr9R2OYIzonwIkoGI4M9dhfKW6RWeRnZjfwSrpN8" crossorigin="anonymous"></script>
</body>
</html>
I want to init my worker like this:
export const initWorker = (token) => {
return new Twilio.TaskRouter.Worker(token);
}
but it's giving me this error: 'Twilio' is not defined. but it's actually working and returning the Worker object. is there way to ignore or to say Vue js that I'm expecting Twilio?
Found a fix, you have to tell eslint that you'll have this as global, there are two ways to go:
add this before your variable call:
/* global Twilio */
or edit your eslint config:
'globals': {
'Twilio': 'readable'
},

My index page does not link to the stylesheets folder located in public / stylesheets

I have the following view
app/views/people/index.html.erb
and layout app /views/layout/application.html.erb
Content of application.html.erb
<link href="/assets/all.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/defaults.js" type="text/javascript"></script>
but when I go to localserver:3000/people
The styles of the public / stylesheets folder are not applied
The source code localserver:3000/people
<link href="/assets/all.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/defaults.js" type="text/javascript"></script>
Adding this line to your index.html.erb should do the trick
<%= stylesheet_link_tag "all" %>
For more details,see this API

YiiBooster theme not working

i'm newbie to yii & i'm trying to install booster as well described in the home page but without sucess.
the extension works, i generated CRUDs using 'bootstrap.gii' but i steel having the classic blueprint theme. there is my view output :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<!-- blueprint CSS framework -->
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/screen.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/print.css" media="print" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/ie.css" media="screen, projection" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/main.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/form.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/bootstrap-yii.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/jquery-ui-bootstrap.css" />
<script type="text/javascript" src="/thouraya_booster/assets/f74bdb93/jquery.js"></script>
<script type="text/javascript" src="/thouraya_booster/assets/b50f179f/js/bootstrap.bootbox.min.js"></script>
<script type="text/javascript" src="/thouraya_booster/assets/b50f179f/js/bootstrap.js"></script>
<title>My Web Application</title>
</head>
i tried to add manually the bootsrtap theme as it use to be with chris's bootstrap extention but i'm getting this error message Bootstrap and its behaviors do not have a method or closure named "register".
i tried to manually modify the layouts/main.php exchanging the blueprint loading css by <?php echo Yii::app()->bootstrap->registerCoreCss(); ?> but it dosn't work
i even tried a chmod777 for if access is denied to some css file and the extension is then replacing it by the yii's default one.
here is how my config file looks like:
...
// preloading 'log' component
'preload'=>array(
'log',
'bootstrap',
),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
'modules'=>array(
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'root',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
'generatorPaths' => array(
'bootstrap.gii'
),
),
),
// application components
'components'=>array(
'bootstrap' => array(
'class' => 'ext.bootstrap.components.Bootstrap',
'responsiveCss' => true,
),
...
I don't know if i'm missing something somewhere.
I had the exact same problem, here is how I solved it:
I created a new clean webapp (using yiic webapp) and installed YiiBooster as you have
Get YiiBoilerplate and unzip it somewhere
Go to {unzipped}backend/views/layouts/ and grab main.php, column1.php and column2.php
create a new theme in your webapp under the /themes folder (I called it 'booster')
Copy the three files from (3) into themes/booster/views/layouts
In your main.php add 'theme' => 'booster' as a top-level entry of the array (I put it first)
P.S. Love your Avatar...
In file views/layouts/main.php delete in HEAD Yii::app()->bootstrap->register();
I got simpler, step-by-step method:
Extract yiibooster to extensions folder and rename the folder into "yiibooster"
Add the following code in /protected/config/main.php
Yii::setPathOfAlias('booster', dirname(__FILE__) . DIRECTORY_SEPARATOR . '../extensions/yiibooster');
Still in the /protected/config/main.php components add:
'bootstrap' => array(
'class' => 'booster.components.Bootstrap',
),
In any controller I want to use YiiBooster widgets, just put the following code:
public function filters()
{
return array(
array('booster.filters.BootstrapFilter - delete')
);
}
And thats it! Now Try to put some button in your view, for example:
$this->widget(
'booster.widgets.TbButton',
array(
'label' => 'Primary',
'context' => 'primary',
)
);
Trust me, this really works. I've applied it to my project.
Source:
http://www.yiiframework.com/forum/index.php/topic/52918-yiibooster-installation-steps/

How to use spree_bootstrap_theme in Spee

I feel a little obscure in understanding the Guide to install spree_bootstrap_theme (https://github.com/Andrewmp1/spree_bootstrap_theme) . Do you have any suggesions for me? Thanks a lot!
Below is what I have done:
Create a new sandbox for spree.
Add to Gemfile:
gem 'spree_bootstrap_theme', :git => 'git://github.com/Andrewmp1/spree_bootstrap_theme.git'
Rename application.css inside stylesheets to application.css.scss
Create a new file: bootstrap_and_overrides.css.scss inside stylesheets folder.
Add to bootstrap_and_overrides.css.scss this below line:
#import 'store/spree_bootstrap_theme';
Open application.js, add:
//= require bootstrap
Run rails server
Result I received: http://imageshack.us/f/405/spreet.png/
As you can see, the layout was broken.
I view source the file and do not see anything about bootstrap. What I got is here:
<meta content="Spree demo site" name="description" />
<link href="/assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<link href="/assets/normalize.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/skeleton.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/screen.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/spree_core.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/spree_promo.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/store/all.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<meta content="authenticity_token" name="csrf-param" />
<meta content="BoSR3FtvQBjqF68s7amtXGMVypmaW68e7tHhRzYvqzw=" name="csrf-token" />
<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/jquery.validate/jquery.validate.min.js?body=1" type="text/javascript"> </script>
<script src="/assets/store/checkout.js?body=1" type="text/javascript"></script>
<script src="/assets/store/product.js?body=1" type="text/javascript"></script>
<script src="/assets/store/cart.js?body=1" type="text/javascript"></script>
<script src="/assets/store/spree_core.js?body=1" type="text/javascript"></script>
<script src="/assets/store/spree_promo.js?body=1" type="text/javascript"></script>
<script src="/assets/store/all.js?body=1" type="text/javascript"></script>
I TRIED TO ADD gem 'bootstrap-sass' to the Gemfile too but the result in both case is THE SAME as above.
I've just created a file, inside stylesheets/store, named "spree_bootstrap.scss" with the content:
#import 'store/spree_bootstrap_theme'
After that, i removed the code below from stylesheets/store/all.css
*= require store/spree_core
*= require store/spree_promo
And the same for javascripts/store/all.js:
//= require store/spree_core
//= require store/spree_promo
And i included the following, in javascripts/store/all.js::
//= require bootstrap
Start your server and you'll see the correct style of spree_bootstrap_theme.
I think you should not rename application.css to application.css.scss . The file application.css is a special purpose file . Here you can read about its format and syntax .