You know that you can use jQuery's text() to get an element's contents without any tags.
See this Railscast. Basically you can simply write views like index.xlsx.erb: ID Name Release Date Price <% @products.each do |product| %> <%= product.id...
When making requests using curl, no cookies are sent or stored by default. However, you can tell curl to re...
...it is not available for format determination and Rails will set the format to html. Unfortunately, the constraint won't complain in this case and Rails even renders the sitemap.builder...
With defaults, RCov doesn't work the way you how you would like it to. To create a nice test...
HAML SASS helpers partials When done, everything is simply compiled to static HTML and CSS, so no need to install anything on your server. If you receive an...
...live('click', function() { var hash = $(this).attr('href'); var offset = $(hash).offset(); if (offset) { $('html, body').animate({ scrollTop: offset.top }, 'slow'); location.hash = hash; return false; } }); Note that this could basically work...
Imagine the following HTML structure, where the scrolling container has overflow-y: scroll: +--scrolling container+-+ | | | +-child element+----+ | | | ++iframe++ | | | | | | | | | | | | | | +-----------------------+ | | | | <-- actually cut off by | +--------+ | <-- scrolling container +-------------------+ The issue: On iOS, the child...
...a certain class if no animation is wanted. Option 1: Enable animations only for html elements with class 'animate' @app.config ['$animateProvider', ($animateProvider) -> $animateProvider.classNameFilter(/\banimate\b/) ] Option 2: Disable animations only...
{ 'text': 'Task 2' } ] And you have this template: {{task.text}} Which renders this HTML: Task 1 Task 2 If you'd like to access the scope bound to the...
This is about converting Haml to ERB and not the other way round which you probably want! This process can...
I prefer using Opera's "User mode" to toggle an outlining of HTML elements quickly. This helps greatly when you want to see the actual dimensions of elements, e.g. for...
Consider the following HTML & CSS: ^ img { background-color: red; } div { border: 1px solid black; } This will leave a margin of about 5px between the lower edge of the image and...
When you print out a HTML pages, all raster images (like PNGs) will appear aliased. This is because a printer's resolution is usually much higher than that of a...
...shouldn't have any text before the doctype declaration. If you've got any HTML comments there, for example, the IE will switch to quirks mode. Finally, check if you...
Sometimes you want/have to send specific http(s) requests. You can do that easy with curl or just write the...
Once Rails knows a given string is html_safe, it will never escape it. However, there may be times when you still need to escape it. Examples are some safe...
...HTML that you pipe through JSON, or the display of an otherwise safe embed snippet. There is no semantically nice way to do this, as even raw and h do...
other_attributes_hash = { :url => ..., :method => ...,...
disable_link_option = { :before => "$('your_link_selector').html('#{escape_javascript(dummy_link)}'" } # jquery = link_to_remote(label, other_attributes_hash.merge(disable_link_option...
REST Client to ask the server for default text/html that way: RestClient.get(site, {:accept => :html...
...be rendered by calling JST['path/to/template'](template: 'variables'): Hello, <%= name %> ! // application.js //= require templates/hello $("#hello").html(JST["templates/hello"]({ name: "Sam" })); Whatever is in the <%...
...%> is evaluated in Javascript. You can also...
...headers, body = response puts status # e.g. 200 puts headers.inspect # hash of headers puts body.body # html of response body Instead of Rails.application you can also call any Rack application...
...see in this order: """ Alpha Group Augsburg Berlin Beta Group """ The step ignores all HTML tags and only tests on plain text...
This step tests whether a given select option comes preselected in the HTML. There is another step to test that an option is available at all. Capybara Then /^"([^"]*)" should be...
...will show you, that RTeX tries to generate a PDF document out of a HTML file, which won't work...