[Rails] Rails 4 app with has_many through

2015-04-08 Thread Nikolay Lipovtsev
I need to make an application in which there are two models: User and Company. In this case, users may be employees of the company, and then the user must be associated with Company model, and if the user is not an employee of the company, the connection with the Company model should not be. I

[Rails] How to make spec and dummy in ruby gem project

2014-09-12 Thread Nikolay Lipovtsev
I'm trying to make my first ruby gem project. This is bootstrap form helper. I do not understand how to properly create spec tests for views (test forms, inputs) and dummy. In which folder they should be located and how to write tests? Anybody can show a very simple example tests for the form

[Rails] Ruby on Rails 4: options value in form_for helper

2014-08-04 Thread Nikolay Lipovtsev
I want to make a helper for the bootstrap, and for controls (text_field, label ...) I need to use the options of the form_for. There is a form <%= form_for(@user, url: signup_path, layout: :horizontal) do |user_f| %> <%= user_f.fields_for :person do |person_f| %> <%= person_f.text_field(:last_

[Rails] Re: object.errors not work in Bootstrap Form Helper

2014-07-29 Thread Nikolay Lipovtsev
2014 г., 0:34:23 UTC+4 пользователь Matt Jones написал: > > > > On Sunday, 27 July 2014 06:21:40 UTC-4, Nikolay Lipovtsev wrote: >> >> I made helper ​​for Bootstrap Form. In it I made ​​a separate method >> has_error?, who must determine whether the error messages, but

[Rails] object.errors not work in Bootstrap Form Helper

2014-07-27 Thread Nikolay Lipovtsev
I made helper ​​for Bootstrap Form. In it I made ​​a separate method has_error?, who must determine whether the error messages, but this is not happening. How can I fix it? If there are still errors, omissions, and not the optimal code will once remarks and comments as to optimize (because I