On Apr 12, 2011, at 2:56 AM, Mohnish J. wrote:

Mohnish J. wrote in post #992221:
Walter Davis wrote in post #992117:
On Apr 11, 2011, at 6:05 AM, Mohnish G j wrote:

choice on that ..:) .
In case you aren't able to get a better understanding of what I have
complete method is allowing me to modify the basic functionality to
- Group Specific Profile Pic(s) starting
displayed)                 3(dummy value here)
would look, Kindly register in www.diasp.org and search for any random
    <% for inv_group in @investor_group2 %>
What I need is to implement is a **on click in Rails** which will
If I can figure out how to reduce the formatting space between each of
to

Thank you..



Script.aculo.us Ajax.Autocompleter has a feature for just this
purpose. You can strip your entire onclick business back out, and use just plain vanilla Autocompleter. All you need to do is change a tiny
thing in your Rails view that returns the autocomplete results.
Everything that you don't want to be populated into the result field
when a user clicks should be wrapped in a span.informal.

<li><span class="informal">[image tag]</span>India<span
class="informal">Some other descriptive text.</span></li>

If a user clicks on that option in the suggestion list, only the word
India will be entered into the text field that spawned the
autocompleter.

So in your Rails template for the autocompleter results, just wrap
everything that you don't want to be entered in a span.informal, and
you can have at it. If you wanted fake columns in your results, you
could do:

<li><span class="informal icon">[image tag]</span>India<span
class="informal description">Some other descriptive text.</span></ li>

and use more CSS on .icon and .description to make those "columns" a
particular width.

Walter

Hi Walter,

Thanks a lot , your solution of using the span tag did exactly what I
needed. I have to still play around with trying to fix the width wrt the
fields using CSS. I shall post queries on this , if any.

I have posted the same question on stackoverflow(

http://stackoverflow.com/questions/5595613/implementing-a-onclick-kind-of-functionality-and-formatting-wrt-rails-partial-vie
).

If you have a profile there, kindly post your answer there so that I
could accept the same. Or if you wouldn't want to do it, I with your
permission would submit the same for it to be useful to anyone in the
open source community....


Thanks again..
Hi Walter,

I am a novice wrt sytlesheets and still don't have a good stronghold on
html concepts,

I tried some code below in my _index.html.erb :-


<div class="description">
<ul>
 <%= javascript_include_tag :defaults, :cache => true %>
 <%=stylesheet_link_tag "groups"%>
 <% for inv_group in @investor_group2 %>

 <%=image_tag "investor_groups/#{inv_group.title}.jpg" , :width =>
'40', :height => '22', :align => 'left' %><li><%=h
inv_group.title%>(<%=h inv_group.activated_members.size %>)</li>

 <%end%>
</ul>
</div>


and In my groups.css I did something like:-

.description{
   width: 40%
}
.icon{
   width: 40%
}
.

This change in the code had an affect on the auto complete functionality and now a particular group doesn't get highlighted on doing a mouse over
to it(Kindly refer:-
http://imagepaste.nullnetwork.net/viewimage.php?id=2054 ). I am not sure
where I am doing what wrong that the functionality is getting affected
as a result.

Kindly guide me to correct my mistake(s) on this

Thanks..


Not sure if you've already sorted this out, but if I'm reading this correctly, your code will be generating something similar to this cut- down example:

ul
        img/
        li
                some text
        /li
        img/
        li
                some text
        /li
        ...
/ul

This is completely invalid HTML, so getting CSS to do anything useful with it will be next to impossible.

What you must do is get that image inside the li, where it belongs, and if you don't want it to be in your autocompleter populated content, then wrap the image in a span.informal. If this isn't for your autocompleter results, then you still must put the images inside the li tags, but you have all sorts of tools to get the layout to work the way you expect once you do that.

One of the best tools you can use to get this sort of problem sorted is first to go the validator.w3.org and either put in the URL of your (public) site, or paste in the View Source rendered code from your browser in the Direct Input field. Either one will point out where your layout fails to validate. Once you have valid HTML (think of it as the foundation for your skyscraper) then you can start with the fancy mullions and whatnot of CSS.

And when you get into that end of things, you can use a tool like CSSEdit, which can "override" a stylesheet from your site (either localhost or live) and present you with a preview showing the results of your tinkering in real-time. No need to save, upload, etc. What you see is a "visual merge" between the actual HTML+CSS and HTML+CSS+your changes.

Walter


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to