Open OShalaby-zz opened 9 years ago
@OShalaby are you using the latest version of gem from master? Could you show the html output of you code above?
@stereodenis hi!, thanks for your reply. I have not specified a version in the Gemfile, but bundle show
says version 3.0.3.
from the logged in profile the areas' html output is:
<span class="best_in_place" data-bip-attribute="area_id" data-bip-collection="[[1,"10th of Ramadan"],[2,"6th of October"],[3,"Abbasyia"],[4,"Abou Rawash"],[5,"Agouza"],[6,"Ain Shams"],[7,"Ard El Golf"],[8,"Dokki"],[9,"Downtown"],[10,"El Katameya"],[11,"El Manial"],[12,"El Rehab"],[13,"El Sheikh Zayed"],[14,"El Shorouk"],[15,"El Zeitoun"],[16,"Faisal"],[17,"Garden City"],[18,"Ghamra"],[19,"Giza Square"],[20,"Hadayek El Ahram"],[21,"Haram"],[22,"Heliopolis"],[23,"Helwan"],[24,"Maadi"],[25,"Madinaty"],[26,"Masaken Sheraton"],[27,"Misr El KAdema"],[28,"Mohandessine"],[29,"Mokattam"],[30,"Nasr City"],[31,"New Cairo"],[32,"New Nozha"],[33,"Obour City"],[34,"Shobra"],[35,"Shobra El Kheima"],[36,"Zamalek"],[37,"Agamy"],[38,"Asafra"],[39,"Azarita"],[40,"Bab Sharq"],[41,"Bakos"],[42,"Bolkly"],[43,"Camp Cheaser"],[44,"Carrefour"],[45,"Cleopatra"],[46,"Glim"],[47,"Ibrahimia"],[48,"Kafr Abdo"],[49,"Lauran"],[50,"Maamoura"],[51,"Mandara"],[52,"Manshia"],[53,"Miami"],[54,"Moharam Bek"],[55,"Montazah"],[56,"Mostafa Kamel"],[57,"Raml Station"],[58,"Roushdy"],[59,"San Stefano"],[60,"Semouha"],[61,"Shatby"],[62,"Sidi Bishr"],[63,"Sidi Gaber"],[64,"Stanly"]]" data-bip-object="profile" data-bip-placeholder="Area (Click Me!)" data-bip-type="select" data-bip-url="/profiles/4" id="best_in_place_profile_4_area_id">Agouza</span>
and for the city also from current profile:
<span class="best_in_place" data-bip-attribute="city_id" data-bip-collection="[[1,"Cairo"],[2,"Alexandria"]]" data-bip-object="profile" data-bip-original-content="1" data-bip-placeholder="City (Click Me!)" data-bip-type="select" data-bip-url="/profiles/4" data-bip-value="1" id="best_in_place_profile_4_city_id">Cairo</span>
However from other profiles I see:
<b>4, 1, Egypt ·</b>
Thanks
I have this issue too in latest version of gem from master. @OShalaby, how did you resolve it?
hey @neonix20b I removed the condition from the best_in_place tag and placed it before it so it would be :
<% if current_user.profile == @profile %>
<%= best_in_place @profile, :area_id, as: :select, collection: Area.all.map { |i| [i.id, i.name]}, place_holder: "Area (Click Me!)" %>
<% else %>
<%= @profile.area.name %>
<% end %>
@neonix20b @OShalaby I could help you if you provide a sample app with this bug
Hi, thanks alot for the great gem!
I have profile, area and city models in my rails app:
The problem here is I have a condition so that the current user can edit his profile only (obviously). and it shows the names of the areas and cities no problems, but when I visit another profile I don't see the names anymore, just the ids...If I remove the condition I see names of area and city fine on other profiles but that means any user can edit any profile...anyway of making the names showing not a part of the condition?
Also how can I go on about dynamic selection? (optgroup) i.e.
Thanks