eyp / redmine_spent_time

Redmine plugin that improves the spent time functionality.
Other
57 stars 39 forks source link

Solved problem with empty "Projects" select #18

Closed krewetka closed 12 years ago

krewetka commented 12 years ago

Select with projects wasn't working on my redmine.

All

eyp commented 12 years ago

Thanks for your contribution, but please, explain the problem a little bit more because I don't understand it.

krewetka commented 12 years ago

I'm not Ruby programmer and cannot really explain why but with out this .html_safe my "project" select look like

<select id="project_id" name="project_id">&lt;option value='-1'&gt;-Select Project&lt;/option&gt;&lt;option value="1"&gt;Jetsystem&lt;/option&gt;
&lt;option value="2"&gt;MSS&lt;/option&gt;</select>

instead of

<select id="project_id" name="project_id"><option value='-1'>-Select Project</option><option value="1">Jetsystem</option><option value="2">MSS</option></select>

So it looked like empty select. Making this change fixed it.

eyp commented 12 years ago

It's strange, it works well on everyone else environments.

What's your environment?, OS, browser, etc...?

eyp commented 12 years ago

Well, I've been reading a little bit about this, and it's strange that anybody has had this problem because in Rails 3 (Redmine 2) strings are escaped automatically, so it can't work as expected and .html_safe must be used in this case.

On Thursday (tomorrow is bank holidays here) I'll test it on a Redmine 2. I'm sure the problem will raise and your solution must be the cure.

krewetka commented 12 years ago

Well, I've been reading a little bit about this, and it's strange that anybody has had this problem because in Rails 3 (Redmine 2) strings are escaped automatically, so it can't work as expected and .html_safe must be used in this case.

Yeap, I'm surprised as well that I'm the first one writing about this problem.

On Thursday (tomorrow is bank holidays here) I'll test it on a Redmine 2. I'm sure the problem will raise and your solution must be the cure.

We have bank holiday tomorrow as well :)

Glad my solution might be helpful ;)