haml

force clojure :reload

隐身守侯 提交于 2019-12-08 07:51:17
问题 I noticed that (use 'somemodule :reload) doesn't reload the module if the .clj file was not modified. However I have an usecase for forcing the reload of the module even if the file isn't changed. I created a haml macro for clojure which reads an external file and generates clojure code. ( http://www.coldcode.net/2010/10/haml-macro-for-clojure.html ) I would like thus to be able to reload the clojure module regardless of the file timestamp. Does anybody know if it's possible? (I would like to

When using HAML, is there a way to use heredoc or %Q{ … }?

大兔子大兔子 提交于 2019-12-08 06:09:21
问题 Maybe it can be put into a helper but the existing 500 lines of code has everything in the HAML code, so it is better to follow the existing code for the moment (for tight deadlines). I found the only way working right now is - meta_tag = %Q{\n | <meta ...>\n | <meta ...>\n | [...] \n | } | which is to use the "continuation character" and the \n at the same time. It'd be great if it can be simplified. 回答1: A good way to do this would be to use the :ruby filter or load the needed content into

How do I get an array of check boxes in haml?

会有一股神秘感。 提交于 2019-12-08 04:02:23
问题 I have an array of strings, called @theModels, in a routine implemented as part of a Sinatra server. These models are options for the user to select, and are obtained by the back end (the idea being, as new models are added, then the front end code should not change). I'm using haml to render html. How can I enumerate each element in the list of @theModels such that each element is a checkbox? And how can I obtain which checkboxes the user has selected? I see that just putting = @theModels

Multiline string in HAML

孤者浪人 提交于 2019-12-07 22:53:28
问题 Because I don't want any of my lines to be wider than 80 columns, I want to split the last line into two lines. Adding a comma at the end of the line works as suggested here but then the comma appears inside the string. Is there a nice and clean way of doing this with HAML? - if object.errors.any? %section.form_error_message %h4.form_error_message__title = "#{pluralize(object.errors.size, 'errors')} prevented this form from submitting. Please fix these errors and try again." I want it all to

ActionView::MissingTemplate

喜夏-厌秋 提交于 2019-12-07 10:23:13
问题 I am facing this runtime error after deploying mysite to VPS. note that in my local machine every thing is working fine. when I try to access any view via controller route lets say PostsController#index I got this error Completed 500 Internal Server Error in 3ms ActionView::MissingTemplate (Missing template posts/index, application/index with {:handlers=>[:builder, :erb], :formats=>[:html], :locale=>[:en]}. Searched in: "/home//dev..com/releases/20120413023845/app/views" ): app/controllers

How can I use Cloudinary to output a url with transformation as a string?

牧云@^-^@ 提交于 2019-12-07 07:54:54
问题 I'll preface this by saying that may be approaching this incorrectly. What I'm trying to do is pass the url w/transformation into JS using a data- attribute. Currently, I'm using the following to generate the image tag: = cl_image_tag(image.asset.filename.to_s, transformation: "scroller", :"data-medium" => image.asset.filename.to_s) Which produces this: <img src="http://res.cloudinary.com/bucket/image/upload/t_scroller/v1373070863/s1ufy3nygii85ytoeent.jpg" data-medium="s1ufy3nygii85ytoeent

Possible to change the SASS/Compass output folder for different files?

安稳与你 提交于 2019-12-07 04:43:44
问题 I'm wondering if it's possible for Compass to output files to different directories? I have a fairly large project and while most CSS files go in the /css folder, others need to go in the /admin/css folder. I'm symlinking them for now, but it'd be great if I could define an array of files (in config.rb?) that could be output elsewhere. 回答1: In config.rb edit the css_dir = "/" to your wanted directory! I don't think it can handle multiple output folders. 回答2: One way around it might be to set

What is a good Ruby on Rails forum that can easily integrated to an existing application?

雨燕双飞 提交于 2019-12-07 03:32:18
问题 What is a good, open source RoR 3 forum that can easily integrated to an existing application? Optional features: OpenID support Haml/SCSS templates Support for smilies, YouTube, images, etc I'm probably going to change it alot, and I'm still pretty weak in Ruby, so clean, commented code with good practices would be great. Thanks :) 回答1: The Rails community has never been focused on developing Ruby/Rails forums, conversely to other languages such as PHP. The evidence of that is a really old

Markdown Line Breaks in Code Blocks

馋奶兔 提交于 2019-12-07 02:16:51
问题 Using Redcarpet, when I include something like the following in my markdown, it does not respect any line breaks or indention. I've tried two spaces at the end of lines. Extra lines between code. Nothing seems to work. ```xml <?xml version="1.0" encoding="UTF-8"?> <hash> <money>3</money> </hash> ``` I see: <?xml version="1.0" encoding="UTF-8"?> <hash> <money>3</money> </hash> Here are the Redcarpet settings: Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after

Using Haml with the inline-block spacing gaps

杀马特。学长 韩版系。学妹 提交于 2019-12-07 01:07:53
问题 So I read the solutions regarding making the spacing go away when using inline-block as opposed to floats: display: inline-block extra margin and http://css-tricks.com/fighting-the-space-between-inline-block-elements/. So if you're using haml and want to put the closing tag on the same line as the next opening tag, is there is a solution besides switching to ERB? (and no, I don't want to mess with a css property of the parent container and have to override that in all the child elements).