RailsCasts Pro episodes are now free!

Learn more or hide this

koombea-railscasts's Profile

GitHub User: koombea-railscasts

Comments by

Avatar

Hi, How do I test this using rspec?

This part>

authenticate_or_request_with_http_token do |token, options|
  TOKEN == token
end
Avatar

This is how to support the edit form. Notice the trigger method.

Description: Execute all handlers and behaviors attached to the matched elements for the given event type.

ruby
jQuery ->
  loaded_model = $('#merchant_neighborhood_id :selected').text()
  if loaded_model.length < 1
    $('#merchant_neighborhood_id').parent().hide()
  models = $('#merchant_neighborhood_id').html()
  $('#merchant_city_id').change ->
    make = $('#merchant_city_id :selected').text()
    escaped_make = make.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1')
    options = $(models).filter("optgroup[label='#{escaped_make}']").html()
    if options
      $('#merchant_neighborhood_id').html(options)
      $('#merchant_neighborhood_id').parent().show()
    else
      $('#merchant_neighborhood_id').empty()
      $('#merchant_neighborhood_id').parent().hide()

  $("#merchant_city_id").trigger "change"
Avatar

Encoding::ConverterNotFoundError in Pages#index

Showing /usr/local/rvm/gems/ruby-1.9.2-p320@table/gems/exception_notification-3.0.0/lib/exception_notifier/views/exception_notifier/exception_notification.text.erb where line #22 raised:

code converter not found (UTF-8 to UTF-16)