ruby-on-rails-3.2

why image-path is not resolved in scss?

天涯浪子 提交于 2019-12-19 11:42:53
问题 in my app, I have a scss file, resulted from a gem, resident in the gem folder out side of my app project folder in works just fine locally, I have the path to images correct, like this: (copied from element inspector at chrome) media="all" .social-share-button-twitter { display: inline-block; width: 16px; height: 16px; background: url("/assets/sprites/social-share-button.png") 0px -48px no-repeat; } but, when I deploy to heroku, the image-path is not resolved, I get this result: media="all"

Naming imported scss files .scss or .css.scss

◇◆丶佛笑我妖孽 提交于 2019-12-19 07:56:15
问题 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? 回答1: 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

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

。_饼干妹妹 提交于 2019-12-19 06:19:22
问题 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

ActiveRecord::AssociationTypeMismatch: User expected, got Fixnum

不问归期 提交于 2019-12-18 22:25:50
问题 I don't understand why I get the following error: ActiveRecord::AssociationTypeMismatch: User(#29943560) expected, got Fixnum when I do that in rails console: @game = Game.create(:player => 1060, :played => 1061) I just want to create a new Game regarding model associations below. class User < ActiveRecord::Base has_many :game_as_player, :class_name => 'Game', :foreign_key => 'player_id' has_many :game_as_played, :class_name => 'Game', :foreign_key => 'played_id' end class Game < ActiveRecord

Does Amazon S3 need time to update CORS settings? How long?

爱⌒轻易说出口 提交于 2019-12-18 15:09:23
问题 Recently I enabled Amazon S3 + CloudFront to serve as CDN for my rails application. In order to use font assets and display them in Firefox or IE, I have to enable CORS on my S3 bucket. <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>*<

Does Amazon S3 need time to update CORS settings? How long?

被刻印的时光 ゝ 提交于 2019-12-18 15:09:11
问题 Recently I enabled Amazon S3 + CloudFront to serve as CDN for my rails application. In order to use font assets and display them in Firefox or IE, I have to enable CORS on my S3 bucket. <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>*<

integrating a discourse message board with an existing rails site

北战南征 提交于 2019-12-18 14:17:21
问题 I'm looking at integrating a message board for a site I'm developing in rails. The new discourse board looks interesting http://www.discourse.org/ but there isn't much information about integrating into another site either via oauth2 or sso or perhaps using a rails engine type system. Has anyone succesfully set this up with an app like this? thx edit t Is there a roadmap for how this integration could take place in the future? Parts of it look really intriguing but would like some more info

Rails 3.2.8 Application.js and Application.css are not working as expcted

喜你入骨 提交于 2019-12-18 13:08:42
问题 When i try to include <%= stylesheet_link_tag "application" %> <%= javascript_include_tag "application" %> The content of the files of the application.css is: /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to

Set default value for Postgres JSON column in Rails < 4

本秂侑毒 提交于 2019-12-18 12:58:06
问题 So I'm starting to use the Postgres JSON datatype, now that there's a lot of fun stuff you can do with it. In one of my Rails apps which is not yet Rails 4 (where support for Postgres JSON has been added) I added a JSON column like this: create_table :foo do |t| t.column :bar, :json end but I can't figure out how to set a default value for the column. I tried all variations like {} , '{}' , '{}'::json , '[]'::json etc. but I either get an error when the migration runs or it simply doesn't

Rails - override <head> page element when using a partial or a specific controller view

瘦欲@ 提交于 2019-12-18 12:29:09
问题 Is there a way to append or override the <head> page element inside a rails view? Suppose I have something I only want to include in a particular view's <head> , and I am using the application.html.erb in order to render the rest of my views. In this case I do not want to discard application.html.erb but instead just append to it's head element for one particular page and nothing else. 回答1: In your application.html.erb : <head> <% if content_for? :for_head %> <%= yield :for_head %> <% end %>