Stack Overflow

A language-independent collaboratively edited question and answer site for programmers.

  • on Rails - User object showing nil fields even though they are filled

    stackoverflow.com 14 Aug '16, 3am

    I'm having a weird problem with getting my user registration to work in Rails. When I create a user, it will show all its fields but the password_digest being nil, but when I type something like "u.email", the email will show up. However, it doesn't want to save the user, I assume bec...

  • Rails: ruby class name must base on file name?

    stackoverflow.com 07 Aug '16, 4am

    I'm learning rails 5.0. When I learn Ruby, I know that ruby file name can be different with class name inside. But when I move to rails, I see that ruby file name and class name must have same format. For example, a class name CheckInDetail will be in check_in_detail.ruby . I also see...

  • Elastic Search: how to see the indexed data #ruby-on-rails #elasticsearch #attr-protected

    on rails - Elastic Search: how to see the indexed data

    stackoverflow.com 16 Jul '16, 9pm

    The problem can be solved by grouping data; DrTech's answer used facets to manage this. However, this is being deprecated according to elasticsearch 1.0 reference. Warning Facets are deprecated and will be removed in a future release. You are encouraged to migrate to aggregations inst...

  • How can I rename a database column in a Ruby on Rails migration?

    stackoverflow.com 24 May '16, 9pm

    If the column is already populated with data and live in production, I'd recommend a step by step approach, so as to avoid downtime in production while waiting for the migrations. First I'd create a db migration to add columns with the new name(s) and populate them with the values fro...

  • jquery - Ruby on Rails 4: Troulbe with adding Javascript files in Rails web application

    stackoverflow.com 25 Apr '16, 10pm

    I'm having trouble adding javascript into my rails application. I've added the javascript directly into my application.html.erb file and it works just file. Here is the a script below: //Javascript// $( "#accordion" ).accordion(); var availableTags = [ ]; $( "#autocomplete" ).autocomp...

  • on rails - Send Email notification to a company when user applies to a job

    stackoverflow.com 01 May '16, 3am

    I'm working on a job board that have these relationships, a User can apply to many jobs, and jobs have many appliers (Users). A Company have many jobs. User: has_many :applications has_many :jobs, :through => :applications, :uniq => true Job has_many :applications has_many :users, :th...

  • Migration issue in rails

    stackoverflow.com 13 Jun '16, 6am

    I am willing to create a new model i.e a new table for my application. I have already a table existing for my application and I want to create a new one. But I am facing problem when running rake db:migrate command after executing the following command for creating a new table. rails ...

  • What is the _snowman param in Ruby on Rails 3 forms for?

    stackoverflow.com 21 Feb '16, 2pm

    This parameter was added to forms in order to force Internet Explorer (5, 6, 7 and 8) to encode its parameters as unicode. Specifically, this bug can be triggered if the user switches the browser's encoding to Latin-1. To understand why a user would decide to do something seemingly so...