All Questions

118
votes
2answers
24952 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...
195
votes
11answers
81254 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...
206
votes
7answers
149185 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 ...
257
votes
4answers
64552 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 ?
257
votes
36answers
221013 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=...
284
votes
6answers
210439 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...
203
votes
16answers
131524 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...
89
votes
12answers
66898 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...
807
votes
10answers
150131 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 ...
242
votes
4answers
129256 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