ruby-on-rails-3.2

Sass @import directive when used in Rails engine can't find assets in plugins

独自空忆成欢 提交于 2019-12-01 07:40:43
问题 I was building a Rails engine that uses zurb-foundation's stylesheets, and kep hitting the same Sass::Syntax error. This seemed strange because I had followed the same procedure in a Rails application and it was worked on the first try. So I decided to zero in on the isse by starting two new rails projects--one application and one engine--and configure them to use foundation with a minimal amount of setup. I started with 2 clean Rails 3.2.9 projects--one application and one engine --full and

How to prevent Rails from Action View logging in production

拟墨画扇 提交于 2019-12-01 07:31:08
In rails 3.2.0,is it possible to turn off rails logging for rendering of views in ActionView:: LogSubscriber in production environment. Currently only way i found to supress is to monkey patch it and increase the log level to debug in the below way. Is there a better way to do this or any configuration? module ActionView class LogSubscriber def render_template(event) message = "Rendered #{from_rails_root(event.payload[:identifier])}" message << " within #{from_rails_root(event.payload[:layout])}" if event.payload[:layout] message << (" (%.1fms)" % event.duration) debug(message) end alias

How can i prefill datetime_select with times in custom time zone?

爱⌒轻易说出口 提交于 2019-12-01 06:12:21
问题 I have events that can be in different time zones . Upon edit I want the time & date to show with the time zone of that very event. However, when I hit edit , datetime_select always shows the time of the users time zone (as opposed to the one of the event). Example: Event starting at 10 a.m. in Amsterdam (GMT+1) Users time zone configured as London (GMT+0) Result: Upon edit the event time is falsely preset to 9 a.m. Code snippet: def edit Time.zone = @event.time_zone @event.beginn = @event

Errno::ENOENT (No such file or directory) in amazon-s3

南笙酒味 提交于 2019-12-01 05:53:03
I have application which is deployed to heroku using amazon s3 posting images to buckets.This works perfectly fine. But when fetching same image it gives error: Errno::ENOENT (No such file or directory showing path s3.amazonaws.com/bucket_name/app/public/messages/images/000/000/061/thumb/images.jpeg?1362410115) Same path copying and pasting in browser's url doesn't work. If I am using bucket name as end point it works ie, with following path /bucket_name.s3.amazonaws.com/app/public/messages/images/000/000/061/thumb/images.jpeg?1362410115. But I dont know how to configure this url in my model.

Naming imported scss files .scss or .css.scss

自古美人都是妖i 提交于 2019-12-01 05:32:14
I was trying to get livereload working with rails 3.2, and I came across this question, of which there is a reference to not naming imported sass partials with .css.scss: Rails: Use livereload with Asset Pipeline Is this correct that imported SCSS files should be named file.scss and not file.css.scss? Honestly, I don't think it matters much. As a convention, I generally name files that will eventually be output as an actual CSS file as .css.scss and imported files as .scss. I do the same for .html.haml and .haml for partials. If you want to include .scss file from different directory/folder in

How to prevent Rails from Action View logging in production

流过昼夜 提交于 2019-12-01 05:08:02
问题 In rails 3.2.0,is it possible to turn off rails logging for rendering of views in ActionView:: LogSubscriber in production environment. Currently only way i found to supress is to monkey patch it and increase the log level to debug in the below way. Is there a better way to do this or any configuration? module ActionView class LogSubscriber def render_template(event) message = "Rendered #{from_rails_root(event.payload[:identifier])}" message << " within #{from_rails_root(event.payload[:layout

jQuery's Autocomplete dropdown is not showing after upgrade to jQuery UI 1.10.3

强颜欢笑 提交于 2019-12-01 04:14:20
In my Ruby on Rails app I was using jQuery UI 1.9.2 (through jquery-ui-rails ). I had an Autocomplete field in a Modal Dialog form that was populating it's dropdown suggestion box using Ajax and Json. It worked correctly, showing me the correct suggestions. I subsequently upgraded to jQuery UI 1.10.3 (using bundle update ) and now the Autocomplete dropdown suggestion box is no longer working. It shows no error in the JavaScript console. In fact it shows that the Json that is returned is correct. I have tried rewriting the autocomplete function in JS to perform the call manually (using the

Errno::ENOENT (No such file or directory) in amazon-s3

我与影子孤独终老i 提交于 2019-12-01 03:43:46
问题 I have application which is deployed to heroku using amazon s3 posting images to buckets.This works perfectly fine. But when fetching same image it gives error: Errno::ENOENT (No such file or directory showing path s3.amazonaws.com/bucket_name/app/public/messages/images/000/000/061/thumb/images.jpeg?1362410115) Same path copying and pasting in browser's url doesn't work. If I am using bucket name as end point it works ie, with following path /bucket_name.s3.amazonaws.com/app/public/messages

Ajax queue Backbone js

我与影子孤独终老i 提交于 2019-12-01 03:39:20
I am running Backbone js 0.9.2 on Rails 3.2.2,I have a page for adding cost rows.A cost have 3 TextFields: title, description and price. I am saving each cost on blur. model.save() gets called multiple times with very short intervals. Which issues one create(post) request then one update(put) request shortly there after. The problem I am experiencing is that PUT request sometimes reaches the server before the POST, the result being that model gets created and persisted twice(duplicates). To save on blur is the requested behavior, so I need a way to queue up requests. I have read something

Rails 3.2.8 - Share Devise Sessions Across Subdomains with POW

纵饮孤独 提交于 2019-12-01 03:35:39
问题 I am trying to set up a simple subdomain-based blog in rails 3.2.8. Basically it will have sites, users (authenticated through Devise), and memberships to connect users to sites. I set up POW so that myapp.dev is working properly. Each site has a subdomain and I can navigate to the site#show action using the subdomains with no problems. My issue is that I can't get the Devise sessions to be shared across subdomains. Everything is working fine on my heroku app, but I would like to be able to