Open ParthivPatel-BTC opened 9 years ago
@PragatiDoshi-BTC - You have added update.html.haml, destroy.html.haml and create.html.haml. What is the purpose of these files?
@PragatiDoshi-BTC - Code should be more clean and reusable. The practice is when you iterating any hash or array, it should be in separate partial file. On client index page you have write some itiration code on index page itself. Please move this code into partial use it on client index page.
@PragatiDoshi-BTC - In client Add/Edit form page, What is the purpose of = hidden_field_tag "address_id", @address.id line?
@PragatiDoshi-BTC - In haml or erb files, use form tags instead of html tags. like in clients/_form.html.haml file you have write code for button like
%button.btn.btn-sm.btn-primary{:type => "submit"} %i.icon-ok Save
The practice is use rails form tags instead of html tags like
= submit_tag("Save", class: 'btn btn-sm btn-primary') do %i.icon-ok
Please check all clients' haml pages and use rails tags insted of html tags.
@PragatiDoshi-BTC - On clients listing page, have a look the code for Edit/Delete actions. You have right following code
\
\#{link_to "Edit", edit_client_path(client)}
\
\#{link_to "Delete", "/clients/#{client.id}", 'data-confirm' => 'Are you sure?', method: :delete}
This is not the right way to write rails code. It should be like
= link_to user_path(user) do
%i.fa.fa-eye
= link_to edit_user_path(user) do
%i.fa.fa-edit
= link_to user_path(user), method: :delete, data: { confirm: "Are you sure?" } do
%i.fa.fa-trash-o
Please have a look follwing URLs and change code accordingly http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to http://stackoverflow.com/questions/14052979/haml-and-link-to-rails
@PragatiDoshi-BTC - I am trying to create new client, it shows "Company can't be blank" error message. There is no any input for company. Fix this issue.