Frames in Rails

Hi,

I need the information to create frames in erb rails.

I need to display the links in a frames instead of provide as link to
new
window.

Eg.

Link

This should be modified as

.

I dont need to open a html or new file. The source file will be same
and params will be changed.

Kindly correct the above frameset operations. Its not creating frames.
Kindly suggest me your vision on this issue.

With Regards,
Palani Kannan. K,

On Oct 28, 2010, at 7:28 AM, PalaniKannan K wrote:

target=“new”>Link
and params will be changed.
Kindly correct the above frameset operations. Its not creating
frames. Kindly suggest me your vision on this issue.

With Regards,
Palani Kannan. K,

Step back and ask yourself what problem you are intending to solve by
using frames. If it’s a user interface thing (scrolling area within a
larger page) then you can solve that easily with CSS. If it’s
accessing one view within another, then look into partials – this can
be a very elegant way to solve this problem within a single flat page.

Frames are such a mess to work with in any case, both for you and your
users, because they don’t provide a single URL for a single view. Your
Rails app would have to create an outer frameset page, then a separate
frame src page for each pane of that frameset. What holds these
together? What signals the default content for each sub-frame? If
you’ve got any sort of dynamic content happening within these frames,
what method are you using to glue them all together? If the user
updates one frame, how does that signal back to the others (if any
updates are necessary)? If the user updates one frame or navigates
within that frame, can she ever get back to a default page showing
this combination of information?

Please say a little more about your application, what it does, and why
frames are the solution in your case.

Thanks,

Walter

Hi Walter,

Your suggestion and queries are valuable. I accept your suggestion over
frames.

As u asked the main problem,

Main requirement -> render the same source with different params in a
single
page as second table output. I tried with

render : ‘index’, :params => {:gm => prefer.name, :sp => sp}.

But I am getting “double rendering error”. As render option fails with
above
requirement, I choosed frames to render the different params to execute
with
same source. If you have idea to render the same source file with
different
params, Kindly give me suggestion.

With Regards,
Palani Kannan. K,

On Oct 28, 2:56pm, PalaniKannan K [email protected] wrote:

Main requirement -> render the same source with different params in a single
page as second table output. I tried with

render : ‘index’, :params => {:gm => prefer.name, :sp => sp}.

But I am getting “double rendering error”. As render option fails with above
requirement, I choosed frames to render the different params to execute with
same source. If you have idea to render the same source file with different
params, Kindly give me suggestion.

split your output into partials? Then from your view you can render
your various partials in as many different ways that are needed

Fred

On Oct 28, 2010, at 11:53 AM, Frederick C. wrote:

But I am getting “double rendering error”. As render option fails
with above
requirement, I choosed frames to render the different params to
execute with
same source. If you have idea to render the same source file with
different
params, Kindly give me suggestion.

split your output into partials? Then from your view you can render
your various partials in as many different ways that are needed

If you’re working in TextMate, there’s a macro built in that will do
this for you. Highlight a section of the main view, choose Bundles/
Ruby on Rails/ERb Templates/Create Partial From Selection. It will
prompt you for a partial name, then replace the snippet with a proper
render call and create the properly-named partial in one go.

Blammo. Done.

Walter

Hello Walter D.,
I donot need any dynamic content processings among the frames. i need to
display to different independent static views(pages)
How am i supposed to do that?

On Jan 2, 2013, at 12:33 AM, Anon H. wrote:

Hello Walter D.,
I donot need ant dynamic content processings among the frames. i need to
display to different independent static views(pages)
How am i supposed to do that?

Do you understand how to write a frameset page by hand? You can make one
in a Rails View, just like any other type of HTML. You’ll need to
specify that you don’t want a template, and you’ll need to work out how
you want to transfer your various URLs (one per frame) to the frameset
page, but that’s really just a data-marshalling exercise. Start by
writing the frameset you want to end up with as a single HTML file. Make
sure it works without Rails. Then start pulling out the very few bits of
data you need to use Rails to provide, and figure out what your
controller will need to look like to provide those bits. You should be
able to walk backwards into having Rails generate the frameset if you
start there.

Walter

Walter D. wrote in post #957778:

Frames are such a mess to work with in any case, both for you and your
users, because they don’t provide a single URL for a single view.

Also, frames on certain devices (e.g. iPhone) can be more than a “mess
to work with.” Make every effort to avoid them.

This is what I am using in one of my projects. It should’t be problem to
make it in erb.


def iframe_helper(if_name)

opts = { controller: ‘somectrl’, action: ‘index’, id: @record.id,
iframe: “if_#{if_name}” }
html = “

html << <<EOJS

EOJS

html.html_safe
end

In short:
opts = Hash to make url to display in frame.

iframe html code. if_name=name of iframe.

javascript part which loads iframe code by calling url when document is
loaded. You need jquery for all this to work.

by
TheR

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