All Questions

123
votes
2answers
25638 views

Ignoring timezones altogether in Rails and PostgreSQL

I'm dealing with dates and times in Rails and Postgres and running into this issue: The database is in UTC. The user sets a time-zone of choice in the Rails app, but it's only to be used when gettin...
199
votes
11answers
83508 views

Is Ruby pass by reference or by value?

@user.update_languages(params[:language][:language1], params[:language][:language2], params[:language][:language3]) lang_errors = @user.errors logger.de...
274
votes
5answers
67442 views

What is the difference between <%, <%=, <%# and -%> in ERB in Rails?

Can some one please describe the usage of the following characters which is used in ERB file: <% %> <%= %> <% -%> <%# %> what's the usage of each one ?
210
votes
7answers
151421 views

Override devise registrations controller

I have added a field to the sign-up form that is based on a different model, see How do I use nested attributes with the devise model for the gory details. This part is working fine. The problem now ...
259
votes
36answers
223469 views

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I am using Authlogic-Connect for third party logins. After running appropriate migrations, Twitter/Google/yahoo logins seem to work fine but the facebook login throws exception: SSL_connect returned=...
289
votes
6answers
214123 views

raw vs. html_safe vs. h to unescape html

Suppose I have the following string @x = "<a href='#'>Turn me into a link</a>" In my view, I want a link to be displayed. That is, I don't want everything in @x to be unescaped and dis...
209
votes
16answers
133457 views

WARNING: Can't verify CSRF token authenticity rails

I am sending data from view to controller with AJAXand I got this error: WARNING: Can't verify CSRF token authenticity I think I have to send this token with data. Does anyone know how can I do...
91
votes
12answers
67978 views

ExecJS::RuntimeError on Windows trying to follow rubytutorial

UPDATE: Colin's suggestion of removing the line //= require_tree . has fixed the issue. I have wasted over 2 days trying to follow every suggestion out there and fix my issue. I am trying to follow t...
821
votes
10answers
152766 views

Understanding the Rails Authenticity Token

I am running into some issues regarding the Authenticity Token in Rails, as I have many times now. But I really don't want to just solve this problem and go on. I would really like to understand the ...
244
votes
4answers
130734 views

How is attr_accessible used in Rails 4?

attr_accessible seems to no longer work within my model. What is the way to allow mass assignment in Rails 4?

Previous Next