Bootstrap Navbar, with options updating a yield in the same view?

So after a couple of days of trawling various forums, tutorials etc -
still no closer to doing what is seemingly something straightforward -
namely, have links on a Navbar populate a named yield with the contents
a partial. I’m probably missing something fundamental, but hey! I’ve
this before, but I don’t think I worded the question too well, so
this time I’ll do better!

My view as it stands is as follows:

<!DOCTYPE html>
    <div class="container">
            <ul class="nav navbar-nav">
    <div class="container">

In the <> above, I have tried a couple of ideas. Firstly:

  • P4
  • P4 Output
  • This simply rendered both “perforce” and “p4_output” partials one below
    other, and clicking the navbar options had no effect.

    So then I figured maybe something more like this was required:

  • <%= link_to "Perforce", {:action => 'renderp4'}, :remote => true %>
  • <%= link_to "Perforce", {:action => 'renderp4_output'}, :remote => true %>
  • But at this point I came to a grinding halt, not knowing how what would
    needed in my “renderp4” and “renderp4_output” actions so as to return
    to my mainbody yield - if it is even possible?!?

    Hopefully what I am trying to achieve is obvious - while I appreciate
    acknowledge I am probably rather wide of the mark with my solution
    currently, any guidance would be appreciated. As I say, I’ve hunted
    but just hit a brick wall!

    Thanks :slight_smile:

    On Tuesday, March 25, 2014 8:00:14 AM UTC-4, [email protected] wrote:

    <!DOCTYPE html>
        <div class="container">
                <ul class="nav navbar-nav">
        <div class="container">

    ‘authentication/p4_output’; end %>">P4 Output
    :remote => true %>
    currently, any guidance would be appreciated. As I say, I’ve hunted around,
    but just hit a brick wall!

    Thanks :slight_smile:

    Yes, it’s possible. First, I’m not sure exactly what you’re rendering.
    it’s static, I would load it like you did in your first example and use
    to hide it and display it only when the link is active (much like a drop
    down menu).

    If it’s not static and it’s pulling content then you’re on the right
    except I don’t see that you’re passing any parameters so I’m tending to
    think it’s static. At any rate, if it’s dynamic, you will need
    actions as in your second example. In the controller, you define
    to specific formats (html, js, etc.). The following edge guide should
    you an overview on how to do this:

    Thanks Mike…

    It is dynamic - in the case of “perforce” there is a form with 2
    that get their options from function calls - p4output will (eventually!)
    the contents of a file on the server (This may sound risky, but it’s for
    internal system at work only, so not to panic!)…

    I’ll have a go at the AJAX stuff, and see where I get! Thanks for now :slight_smile:

    This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

    | Privacy Policy | Terms of Service | Remote Ruby Jobs