Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## View, this works
- <%= link_to 'New House', new_house_path %>
- <h1><%= h(@house.name) %></h1>
- <p><%= h(@house.street) %> @ <%= h(@house.zipcode) %></p>
- <% if @residents %>
- <%= render :partial => 'resident', :collection => @residents, :locals => {:house => @house} %>
- <% end %>
- <% unless @user.houses.size <= 1 %>
- <% form_tag selected_houses_path do %>
- <%= select(:house, :id, @user.houses.collect { |h| [h(h.name), h.id] }, {}, {:onchange => "this.form.submit()"}) %>
- <% end %>
- <% end %>
- ## This should also work but it doesnt
- <%= link_to 'New House', new_house_path %>
- <h1><%= h(@house.name) %></h1>
- <p><%= h(@house.street) %> @ <%= h(@house.zipcode) %></p>
- <% if @residents %>
- <%= render :partial => @residents, :locals => {:house => @house} %>
- <% end %>
- <% unless @user.houses.size <= 1 %>
- <% form_tag selected_houses_path do %>
- <%= select(:house, :id, @user.houses.collect { |h| [h(h.name), h.id] }, {}, {:onchange => "this.form.submit()"}) %>
- <% end %>
- <% end %>
- ## Here is the partial
- <p>
- <%= h(resident[:name]) %>
- <% if @house.unapproved_residents.include? resident[:user] and resident[:user] != @user %>
- (approve this user)
- <% elsif @house.unapproved_residents.include? resident[:user] %>
- (awaiting approval)
- <% end %>
- </p>
Add Comment
Please, Sign In to add comment